diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-14 00:35:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-14 01:15:11 +0300 |
commit | d0fb0d0a9d0d698a499d7e38943696a43a7e456e (patch) | |
tree | 22a118d2b1858da9228baad4161d46c0a9175a5e /source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl | |
parent | bbc3ee09e44bfaba1ca2d4ab6a6bf2a51976cdae (diff) |
Fix T60170: Eevee: smoke color does not apply permanently
This was because color is not present in the density texture if there is
only one constant color. Adding it as a uniform.
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl index 0d2d2187a85..c99787eaee8 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl @@ -18,6 +18,7 @@ uniform float noiseOfs = 0.0f; uniform float stepLength; /* Step length in local space. */ uniform float densityScale; /* Simple Opacity multiplicator. */ uniform vec4 viewvecs[3]; +uniform vec3 activeColor; uniform float slicePosition; uniform int sliceAxis; /* -1 is no slice, 0 is X, 1 is Y, 2 is Z. */ @@ -135,7 +136,7 @@ void volume_properties(vec3 ls_pos, out vec3 scattering, out float extinction) float shadows = sample_volume_texture(shadowTexture, co).r; vec4 density = sample_volume_texture(densityTexture, co); /* rgb: color, a: density */ - scattering = density.rgb * (density.a * densityScale); + scattering = density.rgb * (density.a * densityScale) * activeColor; extinction = max(1e-4, dot(scattering, vec3(0.33333))); /* Scale shadows in log space and clamp them to avoid completely black shadows. */ |