TheRealMJP / BakingLab

A D3D11 application for experimenting with Spherical Gaussian lightmaps
MIT License
699 stars 91 forks source link

Blender Cycles and EEVEE SG's #11

Open sasa42 opened 5 years ago

sasa42 commented 5 years ago

Question. After playing around with BakingLab i am asking myself if Blender Cycles as Path Tracer for baking LightmapSG s and Blender EEVEE for fully show off would be working?

A fan.

TheRealMJP commented 5 years ago

Unfortunately I have no experience with Blender or its path tracer, so I'm not sure how well it would for baking lightmaps. Generally though if you have the ability to write some code or script that receives the resulting radiance for a ray direction and that can write out the final lightmap texel value, then you would be able to encode the lighting as SH/SG/etc.

sasa42 commented 5 years ago

I did some fast tests. Some pictures for better explanation. Simple Geo with IBL and Disneys Principled materials. Blender Cycles. Path-traced.

Cycles

Blender EEVEE (Rasterisation) with an precalculated irradiance volume and an reflection probe. EEvEE

EEvEE_Probes

model from katarn66: [MEDIA=youtube]Q09wNDtAtVE[/MEDIA]

I searched for the already integrated SH Lightprobes in the Blender Source Code and found some of the spherical_harmonics_L2 and hl2_basis code.

https://github.com/sobotka/blender/blob/ef0e06d7644727883c250975133264b046930b70/source/blender/draw/engines/eevee/eevee_lightprobes.c

https://github.com/sobotka/blender/blob/ef0e06d7644727883c250975133264b046930b70/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl

The SG Probe volume generation could be pretty forward because the implementation for SH L2 is already there.

The SG Lightmap generation like you did in BakeLab could be harder to add.

But it think to have SG Lightmaps and SG Volume plus mix it with Reflection Probes like you did in The Order could be archive really nice results in EEVEE too and would allow to use your methods in an comfortable open source project.

For now i am not sure how the SH L2 are calculated in EEVEE . But the comparision with ground truth and generation of SG s would be really fast and flexible with Cycles. Cycles can run on CPU, CUDA GPU and since today even on Optix RTX path per option. https://code.blender.org/2019/07/accelerating-cycles-using-nvidia-rtx/?utm_source=www-homepage So pretty fast an flexibel.

All my scenes i did over the last years have perfectly LightMap UV's on UV1.

After baking several days all your test scenes in Bake Lab i am really amazed by the results and see I see so much potential for HQ scenarios with framerates 60+.

Also all the comfortable authoring like create Lightmap UV, create Irradiance Volumes, create Reflection Probes , create bake jobs...... is already there in Blender. So hope you can understand why i am so “hyped“.)

dandingol03 commented 2 months ago

I did some fast tests. Some pictures for better explanation. Simple Geo with IBL and Disneys Principled materials. Blender Cycles. Path-traced.

Cycles

Blender EEVEE (Rasterisation) with an precalculated irradiance volume and an reflection probe. EEvEE

EEvEE_Probes

model from katarn66: [MEDIA=youtube]Q09wNDtAtVE[/MEDIA]

I searched for the already integrated SH Lightprobes in the Blender Source Code and found some of the spherical_harmonics_L2 and hl2_basis code.

https://github.com/sobotka/blender/blob/ef0e06d7644727883c250975133264b046930b70/source/blender/draw/engines/eevee/eevee_lightprobes.c

https://github.com/sobotka/blender/blob/ef0e06d7644727883c250975133264b046930b70/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl

The SG Probe volume generation could be pretty forward because the implementation for SH L2 is already there.

The SG Lightmap generation like you did in BakeLab could be harder to add.

But it think to have SG Lightmaps and SG Volume plus mix it with Reflection Probes like you did in The Order could be archive really nice results in EEVEE too and would allow to use your methods in an comfortable open source project.

For now i am not sure how the SH L2 are calculated in EEVEE . But the comparision with ground truth and generation of SG s would be really fast and flexible with Cycles. Cycles can run on CPU, CUDA GPU and since today even on Optix RTX path per option. https://code.blender.org/2019/07/accelerating-cycles-using-nvidia-rtx/?utm_source=www-homepage So pretty fast an flexibel.

All my scenes i did over the last years have perfectly LightMap UV's on UV1.

After baking several days all your test scenes in Bake Lab i am really amazed by the results and see I see so much potential for HQ scenarios with framerates 60+.

Also all the comfortable authoring like create Lightmap UV, create Irradiance Volumes, create Reflection Probes , create bake jobs...... is already there in Blender. So hope you can understand why i am so “hyped“.)

hi , do you know how blender Interpolate light probe volume?