Hi,
I'm wondering how I can use the deferred rendering methods used to add light onto geometry and convert it to project textures (decals) instead. I've been trying some things, but I keep getting stuck. Can you give any insight on how this can be achieved using a approach that is most compatible with Sunburn (ie. using the depth generated by the renderer etc.)
Contributor on the SunBurn sgMotion Animation Library open source project.
Hi Tom,
I think this thread has the best decal approach - it renders the decals after RenderManager.Render() and uses the deferred lighting-buffers to illuminate decals as if they were painted directly onto a surface.
Let me know if this helps!
Follow me on Twitter – development and personal tweetsAwesome XNA Videos – Lighting, Rendering, and game videos
I wish i'd got it to work :)
I've not spent much time on it to be honest as i've been concentrating on other areas, but it's something i'm still keen to get working.
I found an article on volume decals http://www.humus.name/index.php?page=3D which although useful for splatter decals doesn't entirely do what i was thinking of in terms of standard decal textures (although changing the shader should i think just be a matter of using a 2D texture instead of a 3D one)
I'd love to hear if you make any progress on this Tom, i may revisit it myself and see if i can get something working since i need to get it going eventually.
Another link which might be useful
http://books.google.co.uk/books?id=WNfD2u8nIlIC&pg=PA272&lpg=PA272&dq=A+Deferred+Decal+Rendering+Technique&source=bl&ots=eLrEQypbIW&sig=bWB0pTmQHYcG0vaRcvYZaZcOaMo&hl=en&ei=4pBqTIfcFcq6jAewttmUAQ&sa=X&oi=book_result&ct=result&resnum=6&ved=0CD0Q6AEwBQ#v=onepage&q=A%20Deferred%20Decal%20Rendering%20Technique&f=false
Can't seem to post the link --
Do a seach for 'Game Engine Gems, Volume 1' on google books. Chapter 20
bamyazi: http://books.google.co.uk/books?id=WNfD2u8nIlIC&pg=PA272&lpg=PA272&dq=A+Deferred+Decal+Rendering+Technique&source=bl&ots=eLrEQypbIW&sig=bWB0pTmQHYcG0vaRcvYZaZcOaMo&hl=en&ei=4pBqTIfcFcq6jAewttmUAQ&sa=X&oi=book_result&ct=result&resnum=6&ved=0CD0Q6AEwBQ#v=onepage&q=A%20Deferred%20Decal%20Rendering%20Technique&f=false
The link did work in my gmail for some reason, it's a pretty good resource. However I'm still stuck on the issue, luckily it's not a high priority issue, so I can keep working on other things in the meanwhile. It's hard to believe that there are so little opensource samples/tutorials about it...
I'd agree, there seems to be a distinct lack of any examples of achieving projected decals in deferred rendering.
You've tweaked my interest in getting this working again, I'll post anything i come across which might be useful.
Definitely let us know if you find anything. I've gone through pretty much the game thing, wanting to get it to work, but never spending too much time on it as it's not quite a high priority subject just yet. Though, I'd really like to get it to work some time.
Most of the people I've seen talking about it, use some kind of modified "light" shader for their decal implementation, since we haven't created the deferred rendering in the first place, that leads us nowhere...
http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/
the above link seems pretty useful to get a better understanding on how the lights are rendered, and might help in rendering decals as well...
Hi guys,
Are you looking to add decals on top of existing surfaces? As mentioned in the thread I linked to this should be relatively easy, I would suggest:
This will allow decals to blend as if they were painted onto the surface behind them.
My current implementation uses simple plane meshes to render onscreen, but I'd like the decals to work on non flat geometry, or even spread across multiple meshes in the scene.
That's almost exactly what i've been trying to do, effectively using the decal as if it was a frame of film held in front of a spot light such that it is projected onto the geometry. In my head the process for doing this should be almost identical to rendering a spotlight, but instead of calculating the lighting where it hits the geometry it samples the decal texture and uses that colour instead.
bamyazi:In my head the process for doing this should be almost identical to rendering a spotlight, but instead of calculating the lighting where it hits the geometry it samples the decal texture and uses that colour instead.
That's probably the easiest way to handle projected decals. Though you'll need to control the projection distance, so decals do not project onto objects behind the target.
The SunBurn shader library has the tools to allow you to create the shader. The decal could be rendered as a cone or box "projection volume", with the shader sampling from the depth gbuffer, retrieving the view space position, and then projecting from the decal projector location to the on-screen view space position.