🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Multiple IBL cubemaps in deferred rendering

Started by
1 comment, last by JoeJ 2 years ago

I'm currently working on a deferred renderer (C++/Vulkan) and was able to successfully implement IBL.(Single precomputed Cubemap which is passed to a fullscreen pass/shader which then applies indirect lighting on each pixel according to metallness/roughness values ,etc…)Basically the exact same thing that is described in this tutorial for OpenGL: https://learnopengl.com/PBR/IBL/Diffuse-irradiance\

Issue is that i would like to use multiple cubemaps to light the scene accordingly.

One of the possible solutions that i can come up with from the top of my head is to store multiple cubemaps in a 2D array, Create a 3D array (voxels) which encompasses the whole scene and store the cubemap id (from the array) for each voxel which represents the lighting for the particular area. During (or after) the gbuffer pass the shader would calculate the 3D position of the pixel in the 3D scene, look up the ID of the cubemap for this particular position and store this in a seperate rendertarget.

During the lighting pass the shader would then retrieve the ID for the given pixel, retrieve the cubemap from a submitted cubemap array in the shader and light the pixel accordingly.

Issue with that is that neighbouring cubemaps are unknown (no blending/transition between them) and the fact that there is only a limited number of samplers that can be submitted at once to a single renderpass. (so multiple renderpasses would have to be used.)

What's the general solution for storage of lightprobes and then the retrieval/blending between them in a deferred renderer? (Possibly with as few renderpasses as possible?)

Are there any articles that i can look up as to how this could be implemented for a bigger scene?

/Edit: apologies for the formatting. Had to rewrite the post multiple times as the text was only partially submitted each time.

/Edit2: I stumbled upon this post: https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/​ which explains a couple of approaches to solve this problem. This has also some additional info as well as other links regarding this matter: https://hub.jmonkeyengine.org/t/pbr-indoor-scenes-light-probes/37975/2
Still i'm open for additional input.

/Edit3: Another thing i found: https://stackoverflow.com/questions/25684287/implementing-environment-mapping-and-ibl-for-deferred-shading

Advertisement

Lewa said:
Issue with that is that neighbouring cubemaps are unknown

Why? You can look up 8 IDs closest to the pixel and interpolate all 8 cubemaps, like a 3D texture would work?

One more resource might be Nvidia RTX GI, formerly DDGI. There was some paper from Morgan McGuire, explaining their use of environment depth maps to prevent some light leaking.
Otherwise it's just a dense regular grid of probes, so probably the same thing you want to do.

This topic is closed to new replies.

Advertisement