Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jonnii

Combining Shaders...

This topic is 5389 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

Hello, I have a shader that performs skeletal animation on a mesh in a static vbuffer. I also have a shader for extruding shader volumes. The question is, how can i combine these two without writing a new shader and copy/pasting the two together? Is it possible to load two vertex shaders, or combine them somehow? thanks

Share this post


Link to post
Share on other sites
Advertisement
A vertex shader typically transforms the input (vertices, texture coordinates, constants and matrices). Besides some data manipulation/adjusting it transforms them from 3D to screen space using the matrices.
A second shader would then have to work on screen space coordinates while it is now written for model space, it would be difficult. The second one certainly can''t do the matrix transforms again, the output would be wrong.
It would be the best thing to combine those two into a new shader, where you take care that you only do the matrix transforms once.

Share this post


Link to post
Share on other sites

  • 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!