Page MenuHome

Volumetric influence control for lights
Needs ReviewPublic

Authored by Alexander Court (spiegelball) on Mon, Dec 3, 7:51 PM.

Details

Summary

This patch adds to ability to control how much energy a light contributes to volumes in EEVEE. It also optimizes shader calculation for lights which don't contribute energy to volumes.

Since this is my first time digging into blender code, there might be some code issues. Especially I am not sure about best practices for byte padding in structs.

Diff Detail

Event Timeline

This is a nice patch. The only thing missing is that the influence radius should take the volume power into account (see light_attenuation_radius_get).

It would be a great opportunity to fix the two /* XXX : Removing Area Power. */ present in the lighting code.

Also you should try to use arcanist to upload patches.

source/blender/draw/engines/eevee/eevee_lights.c
715

this is not needed.

source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
33

influence here is misleading, it could be the influence radius. Just pad_volume should be enough. With comment w: volume power.

51

same here l_volume should be enough.

source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl
47

Prefer using == 0.0. And remove abs().

57

Comment with /* */

58

Prefer using 1e-8. And remove abs().

Alexander Court (spiegelball) marked 6 inline comments as done.Tue, Dec 4, 8:25 PM

This is a nice patch. The only thing missing is that the influence radius should take the volume power into account (see light_attenuation_radius_get).

How can the volume power be included there without influencing shading on non-volume fragments?

It would be a great opportunity to fix the two /* XXX : Removing Area Power. */ present in the lighting code.

I'll have this in mind but at the moment coding time is limited. :(

Also you should try to use arcanist to upload patches.

I'll look into it.

Thanks for reviewing.