c++ - OpenGL ES 2.0 shader integer operations -
i having trouble getting integer operations working in opengl es 2.0 shaders.
gl_shading_language_version: opengl es glsl es 1.00
one example lines i'm having issues is: color.r = floor(f / 65536);
error:
error linking program: error:semantic-4 (vertex shader, line 13) operator not supported operand types
to give more context what's happening, within library working way pass color float 3 integers have been bit shifted into. 3 (8-bit) int -> float pass shader | float - > r g b (using integer manipulation) works fine on normal opengl having trouble making work on raspberry pi.
full vexter shader code here:
attribute vec4 position; varying vec3 texcoord; uniform mat4 model; uniform mat4 view; uniform mat4 proj; vec3 unpackcolor(float f) { vec3 color; f -= 0x1000000; color.r = floor(f / 65536); color.g = floor((f - color.r * 65536) / 256.0); color.b = floor(f - color.r * 65536 - color.g * 256.0); return color / 256.0; } void main() { texcoord = unpackcolor(position.w); gl_position = proj * view * model * vec4(position.xyz, 1.0); }
any ideas how working?
Comments
Post a Comment