[css-shaders] Feedback for the spec's default shader s

Hi
I've been following the CSS shader proposal, and am very excited about it.
I think one tricky issue that we have to figure out ahead of time in that spec is the default shaders, since those shaders are going to be overridden with the default uniform names in mind etc.

The issue that popped when I saw the default fragment shader is that it doesn't include an opacity uniform. This would mean, that layers with a custom CSS shader plus opacity would have to render the layer into an intermediate buffer (FBO), and then paint them again with opacity. This, in many cases, would be unnecessary overhead.
Therefore, my proposal for the default fragment shader is something along the lines of:

varying vec2 v_texCoord;
uniform sampler2D s_texture;
uniform float u_opacity;
void main()
{
    gl_FragColor = texture2D(s_texture, v_texCoord) * u_opacity;
}

There is also an issue with making sure those custom shaders are OpenGL ES2 compliant, in essence allowing percision identifiers (lowp/highp), or another strategy to make sure people create shaders that work across GL and GL ES2.

Hope this piece feedback is sent to the right place :)
No'am

Received on Friday, 14 October 2011 22:12:07 UTC