Advertisement Jump to content


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


Decal Clipping

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

Ive been playing around with this for a while and was wondering if anyone knows of a good way to clip a decal to a surface. The way I''m currently doing it seems to work but generates alot more polygons than it seems should be needed to map the decal to the surface. Basicly Im clipping the decal against the polygon hit by the ray trace. For each edge of the polygon I clip the decal and rotate the fragment outside the edge around the edge so it is planar to the adjacent polygon. After the decal has been clipped to all edges I break it up into triangles and add then to my triangle list. I then go back and clip each fragment against its respective polygon the same way. This repeats until no more fragments are generated. This will clip the decal and lay it out onto the surface, but it generates alot of extra polygons. Just wondering if anyone else knew of a better way to clip a decal or maybe has a few tips to optimize this is bit...

Share this post

Link to post
Share on other sites
Got code, but basically i do the inverse thing for another purpose, anyway i use the following approach, i compute the edge normals , for a triangle , i project the ''target'' triangle over this surfaces, i perform a fast clipping i don''t add extra triangle i use a polygon structure , since i know the polygon is always convex i fastly decompose it into triangles, compute the correct texture coordinates , and render the triangle(s)
if you want more details ( and my code just email me )

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!