Skip to main content
gamedev.net
🔒 Locked

Decal Mapping

Started by Brother Erryn 7 replies 600+ views
Original Post
Brother Erryn
Brother Erryn
Where can I find information on this? For those that don't know what it is, it's where a decal conforms to complex geometry. I've Googled myself senseless without success. [edited by - Brother Erryn on January 24, 2003 3:04:16 PM]
Brother Erryn
Brother Erryn
Hmmm....have I stumped everyone? Or did I not explain what I''m after well enough?
Basiror
Basiror
draw you map

then take your decals disable deapth write
enable blending and use the stencil buffer

http://www.8ung.at/basiror/theironcross.html
Brother Erryn
Brother Erryn
But wouldn''t that stretch the image on non-perpendicular polygons?
Basiror
Basiror
well you can should be able to calculate a quad for the decals

the math behind that isn t very difficult
http://www.8ung.at/basiror/theironcross.html
Brother Erryn
Brother Erryn
But it wouldn''t be a single quad if it stretches across a dozen or more different triangles with different normals...the math to do that is what I''ve been looking for.
darookie
darookie
Actually it's still a quad in the first place.

You need to test for polygon intersections with each of the quads sides. If they're all inside the same poly, you're ready to render by using the interpolated normals of the this poly.

Otherwise you need to split it up (both, pixel and texture coords).

This algorithm is performed recursivly, until all sub-quads are located within a single poly.

Hope that makes any sense
Pat

[edited by - darookie on January 27, 2003 12:11:15 PM]
Brother Erryn
Brother Erryn
Sounds about right...but is there an example/tutorial out there somewhere?
Brother Erryn
Brother Erryn
Any documents/links/tutorials/code out there at all for this?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.