Archived

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

Clipping Decals

This topic is 5935 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.


email

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

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 :/

-David-

Share this post


Link to post
Share on other sites