I want my journal to be top of the list again I've thought of a much more space efficient version of what I posted earlier. Need to write it down.
I'd contemplated a few space-efficient ideas before, but I didn't like them as the space saving seemed to be countered by performance. I'm still not entirely convinced about this method.
To summarise, the current method renders (and *stores*) the results of each light source active in a given scene. It then composites them together to create the final image.
My new idea uses three buffers in a swap-chain style :-
So, the method:
3 render Targets: Buffer0, Buffer1 and Buffer2
...
...
...
So, more formally:
Clear( Buffer0 )Clear( Buffer1 )Clear( Buffer2 )For( All Enabled Lights ){ Disable( All Lights ) Enabled( Current Light ) SetTarget( Buffer0 ) RenderScene() if( Frame is Odd Number ) { SetTarget( Buffer1 ) SetTexture( Buffer0 ) SetTexture( Buffer2 ) AddTextures() } else { SetTarget( Buffer2 ) SetTexture( Buffer0 ) SetTexture( Buffer1 ) AddTextures() } }
Do you have any idea how you'll render some effects like particles ? Ping-ponging buffers is not going to be an option in that case.
That's the main reason why i'm staying away from true HDRI at the moment.