Talk:OpenGL pixel shader: Difference between revisions

Added section about fragment shader compilation errors.
m (Thundergnat moved page Talk:OpenGL Pixel Shader to Talk:OpenGL pixel shader: Follow normal task title capitalization policy)
(Added section about fragment shader compilation errors.)
Line 11:
:: No.
:: I do not have anything against GLSL being added as a language (though given its constraints, I doubt many tasks could be addressed using GLSL). But the purpose of this task is to deploy a "Hello World"-ish GLSL program. And that's not something you can do from within GLSL. --[[User:Rdm|Rdm]] 22:35, 8 January 2012 (UTC)
 
==Fragment shader compilation errors==
 
When I completed and ran my recent Wren entry for this task (a C translation), I noticed that the triangle was being rendered in white - no colored pixels at all. I then ran the C and Go examples and the position was exactly the same!
 
It turned out that the fragment shaders in the C and Go examples which were written years ago were no longer compiling under the current versions of OpenGL/GLSL because they used implicit conversions in the rand() function to convert between integer and float literals. As soon as I added ".0" to the former all three examples ran fine.
 
So I've updated the examples (they should now run under any version) and included code in the Wren example to check for compilation or linker errors to avoid 'silent' failures occurring if the example is ever changed in future.
9,482

edits