Jump to content
  • Advertisement
Sign in to follow this  
HenryKorol

Using default fragment shader with custom vertex one?

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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.

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!