lightmap-switching-tool icon indicating copy to clipboard operation
lightmap-switching-tool copied to clipboard

Lighting scenario blending [enhancement]

Open ArieLeo opened this issue 3 years ago • 5 comments

Any chance to have a blending feature between lighting scenario, not full switch but controllable crossfade between 2 scenario?

ArieLeo avatar May 05 '21 19:05 ArieLeo

Hi ArieLeo, I've been thinking about this recently and it would require major modifications to support blending. As far as I know the lightmaps still have to be Texture2D assets which are a bit annoying to update, using Texture assets would open the possibility to use RenderTexture which would be easier to update. I have not tried light probes blending but I imagine someone with good programming skills could blend light probes in a performant way, but maybe that requires knowledge of high performance code. In the end, it might be easier to solve this by storing GI in a 3D texture which could be blended. This means baking the GI with the lightmapper's custom bake API and providing the 3D texture GI to a custom shader or shader graph.

If I do experiment something it would be most likely the last option as it sounds easier for me, but it would take a while and I have not started yet, also it would be completely incompatible with the current tool.

laurenth-personal avatar May 05 '21 20:05 laurenth-personal

@ArieLeo do you have an opinion on what solution you would prefer ? Do you see other possibilities ?

laurenth-personal avatar May 06 '21 05:05 laurenth-personal

Well if we can have a 3d texture lightmap i assume it would become some kind of irradiance volume? i prefer the 3d volume solution as it would be possible to sample the lightmap for folliages and dynamic objects, they should have more unified lighting looks compared to 2dTex lightmap with lightprobe. The only tricky part is sampling the irradiance volume, i doubt it is a good idea to sample whole scene 3d volume all the time.

ArieLeo avatar May 12 '21 14:05 ArieLeo

on second thought, the solution above can become purely custom GI solution :D

ArieLeo avatar May 12 '21 14:05 ArieLeo

It looks like this is now possible to do with unity's adaptive probe volumes. It seems still a bit experimental, but maybe it works already

laurenth-personal avatar Feb 25 '24 14:02 laurenth-personal