Horde3D

Next-Generation Graphics Engine
It is currently 27.04.2024, 14:37

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Rendering decals
PostPosted: 19.08.2010, 19:47 
Offline

Joined: 16.05.2009, 12:43
Posts: 207
I dont know if I've asked this before, but I'm thinking about how to draw decals. Anyone got any useful info?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rendering decals
PostPosted: 20.08.2010, 06:02 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
There's a lot of different techniques for decas.

The traditional idea is that you render the affected mesh again, except with a projected decal texture and alpha-testing enabled.
This is obviously wasteful, so it's a good idea to use the bounding-box of the projection area to extract only the affected triangles, which you use to create a new temporary mesh for that decal.
Some games even have their artists create a 'decal mesh' - which is like a low-poly LOD, just used for this decal-projection technique.

There's a screen-space technique that doesn't require mesh-generation though. For this you need access to per-pixel position -- in a deferred renderer this should be readily available, and in a forward renderer, you can use a bit of math to reconstruct position from the non-linear Z-buffer values.
The idea is that you draw your decals in the same way that you draw lights in a deferred renderer. You just render the bounding-cube of the decal to the screen, fetch the position of any covered pixels, and perform the texture-projection using the decal's position/size and the pixel's position.
In a deferred renderer you could do this after initial G-Buffer generation, and overwrite the albedo term in the G-Buffer (so that the decals will be lit as usual), but in a forward renderer, you'll also have to include the lighting-math in your decal shader.


Top
 Profile  
Reply with quote  
 Post subject: Re: Rendering decals
PostPosted: 21.08.2010, 21:46 
Offline

Joined: 17.01.2010, 13:30
Posts: 7
There is also another way of decals rendering. You can use geometry shader for quad building and projecting onto object, optimization could be using of Instancing. One quad information for every decal without duplicating in memory. Another way is to using Rendering To Vertex Buffer(another name as Transform Feedback in OpenGL and Stream Out in DirectX 10). You render your geometry to a buffer, then using results from buffer make re-rendering of object using that buffer. The best feature of these methods that you dont have wasted cycles. With R2VB you have every info about geometry and can render lights the same way. And now cons. The first method works better on ATi hardware. On NVIDIA the could be small FPS degrading from frame to frame. The second technique suffers from rendering object twice - one for buffer, one for final rendering. This method works great on NVIDIA hardware, but ATi cards have problems with FPS using that method(degrading is 15% - 30%)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group