Horde3D

Next-Generation Graphics Engine
It is currently 24.11.2024, 17:20

All times are UTC + 1 hour




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Inferred lighting
PostPosted: 12.01.2010, 21:01 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
DarkAngel wrote:
DSF works great now using the nodeIDs

Very good :)

DarkAngel wrote:
However, I'm only half-way done... Next, I need to add proper support for specular lighting, and then the stippling technique for alpha-transparency support. Then it should be ready to be shared around :wink:

This recent blog post could be interesting for you: http://mynameismjp.wordpress.com/2010/01/10/inferred-rendering/. And thanks a lot that you plan to share your work with the community!

maninalift wrote:
This is much faster for greater numbers of lights but do you pay any cost which makes this slower for small numbers of lights?

All deferred shading/lighting techniques have a higher cost at first since the G-Buffer needs to be generated. Usually that cost is amortized rather quickly when you start adding light sources. But most advanced renderers are doing some z-prepass anyway these days to make better use of early z-rejection and since the depth buffer is required for post processing, so the additional cost should be acceptable.


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 16.01.2010, 12:51 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
Almost finished the pipeline today, just a bit of tweaking, and then cleaning up the code (coz it's full of commented out "experiments" at the moment!).

Specular is working as well as it can for a light-pre-pass type pipeline --
With the LBuffer, it accumulates the diffuse lighting in the RGB channels and the specular lighting in the Alpha channel (so that materials can mask out alpha later and keep diffuse).
In the final pass, I can only guess at the colour of the specular contribution (by looking at the diffuse light colour), which is close, but not exactly the same as the current forward/deferred pipelines.

Stippled LBuffers for alpha are working too :D
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 17.01.2010, 17:23 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
DarkAngel wrote:
Stippled LBuffers for alpha are working too :D
Image
Love the retro look! Do you have any shots of the final image using this transparency technique yet?

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 18.01.2010, 08:33 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
swiftcoder wrote:
Do you have any shots of the final image using this transparency technique yet?
This is with RGBA8 GBuffer/LBuffers. 50% LBuffer resolution (which means 25% resolution for alpha polys).
The guys in the background receive very few usable lighting samples, and because they have strong specular highlights in this demo the highlights flicker on and off as they pass between LBuffer texels :? might have to add a "specular distance fade" uniform...
Image

[edit - moved forward-alpha stuff to a new thread ]


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 26.01.2010, 05:52 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
Really impressive stuff. Getting access to node ids was definitely a great idea.


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 07.03.2010, 19:44 
Offline

Joined: 07.03.2010, 19:38
Posts: 11
I cannot really see the benefits of this technique compared to deferred depth peeling (with the exception of speed of course). The lightning done at low resolution impairs the scene and specular most notably, i'd hate to see what it does to normal maps. And anyway, if you are going to half the resolution why not half the normal map texture resolution too?

I must admit the alpha support is pretty impressive, could someone explain it to me?


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 08.03.2010, 06:04 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
devsh wrote:
I cannot really see the benefits of this technique compared to deferred depth peeling (with the exception of speed of course). The lightning done at low resolution impairs the scene and specular most notably, i'd hate to see what it does to normal maps. And anyway, if you are going to half the resolution why not half the normal map texture resolution too?
You don't have to use 50% res if you don't want to -- at 100% LBuffer res, it's basically the same technique as a "light pre pass" deferred renderer (except with transparency support). In my final implementation, I'd like to expose this % value as a setting that the user can tweak to see the performance/quality tradeoffs.
Quote:
I must admit the alpha support is pretty impressive, could someone explain it to me?
The LBuffer is split up into "blocks" of 2x2 pixels. Opaque surfaces write lighting results into all 4 pixels of a block, but transparent surfaces only write into one of the pixels in a block. This gives you up to 4 "layers" of lighting information, but means that transparent objects are only lit at half resolution (and if you're using a 50% LBuffer, that's half of 50%, or 1/4 resolution). Also, if an opaque surface is covered by alpha layers, then it's lighting quality also degrades (because the alpha lighting info overwrites most of the opaque lighting info).
When reading lighting values from the LBuffer, some shader magic is used to ignore any samples that are from other objects/layers, and perform linear interpolation from the nearest 4 valid samples.


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 08.03.2010, 19:53 
Offline

Joined: 07.03.2010, 19:38
Posts: 11
hmm impressive alpha but then you should fix your alpha objects :) i.e. your alpha objects would have messed up alpha, depth order.


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 09.03.2010, 01:06 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
devsh wrote:
i.e. your alpha objects would have messed up alpha, depth order.
How come?
The alpha objects are depth-sorted as usual and rendered back-to-front so all the ordering and blending-logic is correct.


Top
 Profile  
Reply with quote  
 Post subject: Re: Inferred lighting
PostPosted: 10.03.2010, 21:57 
Offline

Joined: 07.03.2010, 19:38
Posts: 11
back-to-front??? (FPS diving down)

yeh i'd expect that when you interpolate a pixel you take into account other occluders, so sorry. You are right the blending logic is fine.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group