Archived

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

David20321

Clipping Decals

Recommended Posts

David20321    122
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
Lord Karnus    122
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
David20321    122
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