Skip to main content
GameDev.net gamedev.net
🔒 Locked

Combining Shaders...

Started by jonnii Nov 18, 2003 at 5:51 AM 0 replies 600+ views
Original Post
jonnii
jonnii
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
-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
Fidelio66
Fidelio66
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.