Sign in to follow this  
HenryKorol

Using default fragment shader with custom vertex one?

Recommended Posts

HenryKorol    122
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!

Share this post


Link to post
Share on other sites
Rasmadrak    196
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this