diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-16 16:42:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 13:23:05 +0300 |
commit | 7537cad5761e4778da7aed02410c5811114c24e5 (patch) | |
tree | 94b0187257e08ecaeaad5cef9eaaa4ec49aa04fd /source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl | |
parent | 1162ba206dd7792414d3ae716877ba1383de8dab (diff) |
Volumes: add render settings for volume datablock
* Space: volume density and step size in object or world space
* Step Size: override automatic step size
* Clipping: values below this are ignored for tighter volume bounds
The last two are Cycles only currently.
Ref T73201
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl index f5e92cd7495..312fc07054a 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl @@ -8,6 +8,7 @@ uniform vec3 volumeOrcoLoc; uniform vec3 volumeOrcoSize; uniform mat4 volumeObjectToTexture; +uniform float volumeDensityScale = 1.0; #endif flat in int slice; @@ -52,6 +53,12 @@ void main() Closure cl = nodetree_exec(); #endif +#ifdef MESH_SHADER + cl.scatter *= volumeDensityScale; + cl.absorption *= volumeDensityScale; + cl.emission *= volumeDensityScale; +#endif + volumeScattering = vec4(cl.scatter, 1.0); volumeExtinction = vec4(cl.absorption + cl.scatter, 1.0); volumeEmissive = vec4(cl.emission, 1.0); |