#version 300 es
in mediump vec4 basecolor;
out vec4 FragColor;
void main(void)
{
FragColor = basecolor;
}
passing value to ‘x1’ uniform as glUniform2i(loc, 10,20) and drawing as glDrawArrays(GL_POINTS, 0, 1);
It should render green color point, but giving random color.
yes you are right, you NEED to have attributes at all, cause these are the base data for a vertexshader call.
without attributes the shaders won´t be called at all, because:
glDrawArrays() is somthing like:
foreach( attrib as $val )
{
call vertexshader();
}
yes you are right, you NEED to have attributes at all, cause these are the base data for a vertexshader call.
without attributes the shaders won´t be called at all, because:
glDrawArrays() is somthing like:
foreach( attrib as $val )
{
call vertexshader();
}
yes you are right, you NEED to have attributes at all, cause these are the base data for a vertexshader call.
without attributes the shaders won´t be called at all, because:
[/QUOTE]
On desktop GL you don’t need any attributes and I often use attribute-less rendering there. I would be surprised if the GLES 3 specs (the shader was GLES 3) would demand an attribute.
In either case, this isn’t the GL ES forum, it’s the desktop GL forum. Perhaps you’d be better off asking on the GL ES forum as you’re more likely to encounter someone who actually knows?
In theory, no. In practice, I’ve had similar issues with shaders which don’t have at least one attribute.
It may be related to attribute zero being special in the compatibility profile (attribute 0 is the vertex position; calling glVertexAttrib(0,…) between glBegin() and glEnd() causes a new vertex to be emitted, as with glVertex()). It’s also a fairly safe bet that the case of a vertex shader which has no inputs doesn’t get much testing.
Actually a vertex shader with no inputs is the classic use case of drawing a full-screen quad, using gl_VertexID as a source for either looking up or calculating the outputs.