Using default fragment shader with custom vertex one?
Good time of the day,
Currently I am using the GL_EXT_draw_instanced together with the ability to bind the uniform to a buffer to draw geometry instances in my application.
I am using custom vertex shader to transform the model using the matrices in the passed buffer.
I also have to write my own fragment shader to shade polygons.
Does that mean that I need to implement all the lightning equations? Or is there a way to use the "default" fragment shader to do the work for me?
Something is telling me that I can't, because there is not way to modify the active normal, so I would need to pass the normal from vertex shader to fragment shader using a global. But maybe there is still a way that will save me time reinventing the wheel with implementing all the shading equations.
Thanks in advance!
That is correct.
If you really need the "fixed functionality" You can look at 3Dlabs' ShaderGen(sorry couldn't find it on google).
Hope this helps.
If you really need the "fixed functionality" You can look at 3Dlabs' ShaderGen(sorry couldn't find it on google).
Hope this helps.
http://www.lighthouse3d.com/opengl/glsl/index.php?ogldir1
That site contains a lot of good (and effecient?) samples.
It's actually easy-peasey to re-implement the fixed functionality in shaders. :)
/Robert
That site contains a lot of good (and effecient?) samples.
It's actually easy-peasey to re-implement the fixed functionality in shaders. :)
/Robert
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement