# "Bending" decals

## Recommended Posts

I am in the midst of conceptualizing a decal system for my game, and I have ran into some problems regarding how to apply decals to the environment. The problem that I am having is that I don't want decals that go over edges and sticks out, like this:
-------....
|
|

The lines represent a piece of geometry, a slope, and the dots represent the part of the decal that sticks out over the edge. How would I go about bending that part down onto the slope-polygons? I am using OpenGL, and have support for multitexturing, if there is a way to map the decal onto the textures, thus creating some form of effect. I dunno... Any ides and suggestions?

##### Share on other sites
why not just clip the polygons that make up the decal, somehow.

##### Share on other sites
A detailed description of a working algorithm, with code, can be found in one of the first two GPG books in the article 'Applying Decals to Arbitrary Surfaces'. I based my decal system on this article and it works great. It involves some work (clipping triangles, creating the decal volume, etc.) but it's very effective.

##### Share on other sites
And GPG stands for?

##### Share on other sites
Game Programming Gems. Or possibly Graphics Programming Gems, which I'll leave you to google for yourself, but that was more oldskool and more along the lines of rasterizer implementation hacks (at least the bits of it I read were).

##### Share on other sites
Ok thanks, will borrow them from someone and check it out.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627698
• Total Posts
2978681

• 20
• 14
• 12
• 10
• 12