Jump to content
  • Advertisement
Sign in to follow this  
fpsgamer

Quick shader question...

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

Its not possible to perform per-triangle opertaions in a (vertex) shader, right? Is that correct or am I mistaken?

Share this post


Link to post
Share on other sites
Advertisement
If I'm not mistaken (as it's been atleast 8 months since I last coded), no. In a vertex shader, you have no idea what triangle the vertex is a component of, or what "index" it is.

Share this post


Link to post
Share on other sites
Only vertex operations. If a vertex is shared across 2 triangles, whatever calculation is done is shared for both. You *could* create unique vertices per triangle, and, if needed, put some sort of triangle id in your vertex.

In D3D10 you'll have a geometry shader where you can see all the vertices of a triangle (and optionally it's neighbour triangles) and perform whatever you want on that, creating new triangles, lines, and/or points to send to the rasterizer. You can even send different triangles to different render targets.

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!