Hi,
I have a problem with vertex/fragment shaders on Ubuntu Remix on a EEEPC
My vertex and fragment shaders are really very basics :
vertex shader : void main(){ gl_Position = ftransform(); }
fragment shader : void main(){ gl_FragColor = vec4(1,1,0,1); }
And I draw only a shape as this (for the instant, this is only a triangle) :
glColor3f(0,1,0);
glBegin(GL_POLYGON);
glColor3f(1,0,0);
glVertex3f(0,1,0);
glColor3f(0,1,0);
glVertex3f(1,-1,0);
glColor3f(0,0,1);
glVertex3f(-1,-1,0);
glEnd();
When I attach only a vertex shader, I have a red color on the shape and a background in blue.
When I attach only a fragment shader, all the screen is of the color that I have fixed in this fragment shader.
When I attach a vertex shader and a fragment shader, all the screen is too of the color that I have fixed in the fragment shader.
And when I attach nothing, this is logically the default pipeline, so itās OK
(cf. I have a triangle that have smooth transition between red, blue and green on a black background)
And I have too a full green screen if I set only the glColor3f(0,1,0) before the glBegin and without glColor3f into the glBegin/glEnd (with the 3 glColor3f into the glBegin/glEnd I have a red triangle with a blue background)
Where can be the problem : the fragment shader, the vertex shader or the method I use for display the triangle ???
(I donāt think this can be the last because this work very fine when I donāt use shaders)
My source is only 172 lines, perhaps can I put this into the next post if this is necessary ?
I think use the hardware acceleration because glxgears say about 1000 frames in 5.0s (and I donāt think that a eeepc can display at 200 fps with a software only pipeline)
Note that this very work fine (and fast if shaders arenāt recompiled at each iteration) if I set the vertex and fragment shaders just before to display the triangle and make a glUseProgram(0) just after => so in fact this problem can be easily resolved But I donāt understand where is really the problem
@+
Yannoo