ae95ab0c43
A color can be specified to render the geometry of the VBO. For legacy painting glColor is used, for shader a uniform is set. In order to allow rendering without texcoords, it is possible to pass a null pointer as texcoords. Shader added to scene which just renders a colored geometry without texturing.
14 lines
447 B
GLSL
14 lines
447 B
GLSL
#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
// size of the complete display in pixels, x==width, y==height
|
|
uniform vec2 displaySize;
|
|
// geometry of the window/texture to be rendered: x, y, width, height in display geometry
|
|
uniform vec4 geometry;
|
|
|
|
// passed in vertex - only x and y are used
|
|
attribute vec4 vertex;
|
|
|
|
void main() {
|
|
gl_Position.xy = 2.0*vec2(geometry.x + vertex.x, displaySize.y - vertex.y - geometry.y)/displaySize - vertex.ww;
|
|
}
|