So this is a GLSL shader as you can see, and the idea is to use only one channel of an image (here it is the red channel) as alpha map so that i could store up to 4 greyscale alpha textures in only one image.
It worked quite well back on the computer where i wrote this shader but when i came back home to use it on my own one, it doesn’t work anymore and i get the following error :
“No subshaders can run on this graphics card”
and
“GLSL Error in Fragment Shader: Fragment shader failed to compile with following errors: ERROR: 0:37: error(#160) Cannot convert from ‘high float’ to ‘highp 4-component vector of float’ ERROR: error(#273) 1 compilation errors. No code generated at line 0”
Color properties are float4s (or vec4s in GL, I guess).
Also, you’re assigning your alpha channel to be a vec4 - it only needs to be one channel so you need it to be just a float. I think that’s what your error’s about.
I’m not really up on GLSL, but this might work better (bold bits are bits I’ve changed);
Thank you very much farfarer for this quick reply.
It’s working now
I didn’t see this technique treated often so i’m wondering if it makes sense using it on mobile platforms such as iphone.
Do you think it’s worth doing such optimization ? Wouldn’t there be some drawbacks ?