Jump to content
  • Advertisement


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


Clipping Decals

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

Ok I''ve got a square decal and I''m applying it to a triangular polygon, but now I have to clip the decal to the edges of the triangle. Does anybody know how to do this, or have any code to do this, or know where I can find any info on this? Thanks, -David-

Share this post

Link to post
Share on other sites
Well, I''m not sure how fast it would be, but you could use the stencil buffer.
Render the polygon that the decal belongs on to the stencil buffer, then draw the decal.
What you''re asking I''m sure has plagued many developers for a while, as many commercial games have decals that stick out beyond boundaries.
I''d recommend some kind of detection as to whether the edge of the poly creates a concave or convex corner. If concave, the depth buffe should take care of most situations, if convex, use the stencil buffer.


Something kinda sad about
the way that things have come to be.
Desensitized to everything.
What became of subtlety?

Share this post

Link to post
Share on other sites
I don''t think I want to use the stencil buffer for decals, would be kind of slow wouldn''t it?

I''m trying to do something like in quake 3 and unreal tournament (try shooting a rocket at a wall in wireframe, the decal clips to the edges). I''m trying to do something like that :/


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!