Page 1 of 1

Decals

Posted: Fri Nov 20, 2015 11:08 pm
by andrewmac
Added support for deferred decals. Since they're deferred they are cheap and they wrap geometry well:
Image
Image

Right now they're pretty simple but I'm going to add material support so you can make fancy decals with the material editor.

Re: Decals

Posted: Sun Nov 22, 2015 1:11 pm
by Chelaru
Looks good. Any plans for this some thing like this : http://blog.wolfire.com/2009/06/how-to-project-decals/ ?

Re: Decals

Posted: Sun Nov 22, 2015 3:06 pm
by andrewmac
Projected decals are generally considered the old way of doing things (note the article you linked is from 2009). Deferred decals are faster and conform to the surface better. They also don't require additional verts to conform to complex geometry. Is there a reason you'd want projected decals over deferred decals? As far as I know projected are inferior in every way.

Re: Decals

Posted: Sun Nov 22, 2015 4:17 pm
by Chelaru
You are correct. I was thinking at 3d decals. Like when the user makes a dent in the wall, there should be a hole in the wall.

Re: Decals

Posted: Sun Nov 22, 2015 5:23 pm
by andrewmac
That sounds interesting. I'm not familiar with it though. Do you have any references to that? I'm not sure how you'd modify existing geometry in real time with a decal. You can do simple dents and imprints, etc by using normal maps with deferred decals, but it's not actually modifying the geometry.

Re: Decals

Posted: Sun Nov 22, 2015 5:32 pm
by Chelaru

Re: Decals

Posted: Sun Nov 22, 2015 6:18 pm
by andrewmac
That's talking about implicit surfaces though. Implicit surfaces are those defined by a mathematical function. They're usually rendered with raytracing or raymarching. The idea can't be applied to arbitrary geometry rendered with rasterization unfortunately so it doesn't fit into the engine.

The beauty of deferred decals is that they're cheap and apply well to almost any surface. This allows you to use them rather freely. I wouldn't want to add any additional complexity to them that reduces them in either of those areas.

Re: Decals

Posted: Mon Nov 23, 2015 5:43 pm
by Chelaru
You are correct. I was thinking of deformation. If the player would strike a wall, a dent will show on the wall.