//vs
void main(void)
{
gl_Position = ftransform();
}
//fs
void main(void)
{
gl_FragColor = vec4( 0.4, 0.0, 0.9, 1.0 );
}
//vs
void main(void)
{
gl_Position = ftransform();
}
//fs
void main(void)
{
gl_FragColor = vec4( 0.4, 0.0, 0.9, 1.0 );
}
An empty fragment shader is perfectly legal. It just writes undefined values to the color output then.
Mars_999: what do you want to tell with that? There is no such thing as ftransform() and gl_FragColor ir forward compatible context.
So you all went back to writting "hello world" shaders?
"OpenGL 3.0 - A Big Step in the Right Direction"
Of course it's not OpenGL's fault, that drivers don't work, but perhaps clean API would address this problem better...
For the shader problem, try defining GLSL version 1.30 in the shader. That seems to of fixed the compile errors I was getting. Kind of strange though, hopefully they fix these problems with their next release.
Hmm, adding #version 130 helps.
With following fragment shader:
I am getting following error:Code :#version 130 in vec3 fragment_color; out vec3 screen_color; void main() { screen_color = fragment_color; }
Code :Fragment shader compile error: Fragment shader failed to compile with the following errors: ERROR: 0:2: '' : Declaration must include a precision qualifier or the default precision must have been previously declared. ERROR: 0:3: '' : Declaration must include a precision qualifier or the default precision must have been previously declared. ERROR: compilation errors. No code generated.
I changed shader to:
Then everything compiles and links fine (after adding same precision to vertex shader) Thanks rpggamer! I assumed that GL3 forward compatible context by default expects GLSL version 1.30, but I guess you can expect many strange things from ATICode :#version 130 precision mediump float; in vec3 fragment_color; out vec3 screen_color; void main() { screen_color = fragment_color; }
Now when shader program compiles and links fine, I'm getting next error - glBindBuffer(GL_ARRAY_BUFFER, id) generates GL_INVALID_OPERATION error in forward compatbile context. It doesn't matter if VAO is bound or not. id is generated correctly with glGenBuffers. Any suggestions here?
Even glBindBuffer(GL_ARRAY_BUFFER, 0) generates same GL_INVALID_OPERATION.
9.2 driver fixed some things.
glGetString(GL_VERSION) now doesn't crash - it returns "3.0.8494 Release".
glGetStringi(GL_EXTENSIONS, x) now also works - returns correct extension strings.
glGetString(GL_SHADING_LANGUAGE_VERSION) also returns correct value - "1.30".
But still - I can not glBindBuffer(GL_ARRAY_BUFFER, id) with correct id in forward compatible context.