Jump to content
  • Advertisement
Sign in to follow this  
InetRoadkill

Running vertex and fragment progs at same time?

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

Is it possible to run a vertex program and fragment program at the same time? I haven't been able to find a definitive answer. If so, how do you activate them both?

Share this post


Link to post
Share on other sites
Advertisement
The graphics pipeline has several stage, one of which is the vertex stage, and another of which is the fragment stage. You can use either the older fixed functionality or a shader for either of those stages, in any combination.

If you are using GLSL, then you attach both shaders to a 'program', and activate it with glUseProgram().

Share this post


Link to post
Share on other sites
You will normally require a vertex shader to 'feed' your fragment shader. You can run a vertex shader on its own, and I believe (never done this!) a fragment shader on its own too. However they run in order, a quick google led me to a diagram which will save me poorly explaining:



But put simply, vertex data goes into vertex shader. Outputs from there are rasterised into fragments, and those are passed through (with any varying data) the fragment shader. Hope this was of some help [smile]

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!