Jump to content
  • Advertisement
Sign in to follow this  
frat

region filling

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

Consider a closed contour, each segment in the contour is defined by two 3D end points, the contour can thus be expressed as an ordered list of vertices, and the first and the last coincide. Imagine to have the contour laying over a mesh, for example a terrain mesh. I would like to fill the portion of the mesh "inside" the contour with a given color. I used a triangulation algorithm to obtain a mesh from the contour, but I am not satisfied with it because I want the region to lay exactly on the terrain mesh. Do you think it can be done in the pixel shader (or in any other way)? cheers, Marco

Share this post


Link to post
Share on other sites
Advertisement
The easiest way would probably be to draw the triangulated shape to the stencil buffer, then draw the terrain again with stencil testing, only drawing the pixels where the previous shape was drawn.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!