Click here for EyeGasm (RL GI) [FULL SRC && DEMO AVA

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

wont work.. the values will still be with 255 bit precision
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

devsh wrote:wont work.. the values will still be with 255 bit precision
i guess you mean 8bit...
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

devsh wrote:wont work.. the values will still be with 255 bit precision
Not if you spread it across all four channels of say, a PNG. You'd get 32 bit precision. That should be more than flexible enough.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I meant 255 possible values... soz
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

And I'm saying that if you use all 32 bits per pixel (R, G, B, and A channels), you can store a range of 4,294,967,296 possible values between no light and your maximum brightness. That should be more than enough precision.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I just rendered the data into a 32 bit floating point texture instead :)

Mel, you can start clapping... here is the first coefficient of every spherical harmonic for the level (7 more maps like that and im done)

Image
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

You asked about a viable way to save the HDR texture. Unless you just want to save the array of floats in a bitmap-like format, you'd need to do something different like what I suggested or write your own image writer/loader.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

thats a screenshot... store SH differently (binary file)
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

:roll: No, I'm not talking about an HDR screenshot. I'm talking about any HDR texture. I'm only responding based on this:
devsh wrote:okay now it seems I only need to find and adapt the HDR image loader so I can finally stick my samples in a texture :)
Like I said above,
slavik262 wrote:Unless you just want to save the array of floats in a bitmap-like format, you'd need to do something different like what I suggested or write your own image writer/loader.
The other advantage of saving via a pair of PNGs is that you can see what the image looks like with any standard image viewer/editor.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I was thinking static texture containing the entire level... but it will get more fun if I can update that lookup texture by rendering all the SH in camera frustum into it to achieve higher detail
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

Finally Done IT!

This is my GI atlas
Image
Image

Right still at 200 fps and the whole level is NOT lit, textured, lightmapped in any way what so ever... just pure GI per pixel pass (note: there is a bug.. sometimes the GI "leaks" through walls... normal sensitive interpolation could possibly work)
ImageImageImageImage
ImageImageImageImageImage

And what do we have here???
Image
Oh yes... ambient/self occlusion... how good is that
Image

In conclusion...
The leaks on the walls can be eliminated with normal sensitive interpolation and/or taking more samples (which is not possible until irrlicht handles lock() on RTT without memory leak).
SSGI (small radius/scale GI) can be used for the corners (like SSAO) to aid the SH method as light bleeding is sometimes lost there (related to the first problem)
SSAO will add small scale AO

My method + Screen Space methods will give you best image quality as my method handles big crude scale scattering and the SS methods handle small corners and pixelwise AO/GI

You can stick any model in there, move it around rotate and scale and it will pick up appropriate GI. So this will give you an effect like lightmaps except it will affect dynamic objects :) which is not possible with lightmaps.

Off to read crytech's paper about the bleeding issue

P.S. offsetting the interpolation by normal*3/8 of the distance between probes works wonders to light bleeding
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Image

Well done, really well done! :) I thought your approach would be another. You've implemented, then, irradiance volumes, right?... That's a really good way to lit not only levels, but dynamic elements. I am impressed, you've done a great job!
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I'm thinking of actually making a combine/injection stage/filter and some bunnies, cubes and spheres flying around

also volumetric fog lit by spherical harmonics (trust me... interesting) which is not very likely to work out

Also I might add some SSAO+SSGI just to add "2nd bounce"

P.S. However making it dynamic (changing lighting conditions) is black magic to me... like euthanasia I am not touching that with a 20ft pole

Oh damn I got an idea now... second set of Spherical Harmonics encoding a cube map of normals... which can be lit by lights (simple operation) and added to the "ambient" harmonic... oh no must carry out tests now to see if the result of SH(render(light*normals+ambient))==approx==SH(render(normals))*light+SH(render(ambient))
fmx

Post by fmx »

Great stuff, looking forward to seeing how you evolve simple SH :D
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

3 buffers, ambient, diffuse and normal could allow me to introduce dynamic lighting to global illumination and a shadow map could give me a really eyegasmic effect.

I could also prebake SH for static models which move around, with ambient (and normals+diffuse) encoded with RGBA so i can blend them with static gi buffer as they move around... Sure success
Post Reply