diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-10-24 18:52:20 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-10-27 23:49:15 +0300 |
commit | 310f1db7bf508c764dde47ff85bccb31458b1893 (patch) | |
tree | 960c5e0b3860773ed1571c28412b81db10e400c2 /source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl | |
parent | 66d8f82b832b58cba3273c0a4196fae6db0e1efd (diff) |
Eevee: Volumetrics: Add volumetric support to alpha blended meshes.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl index 3e678bbc83f..0115b2cb99e 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl @@ -6,9 +6,6 @@ * Note that we do the blending ourself instead of relying * on hardware blending which would require 2 pass. */ -uniform sampler3D inScattering; -uniform sampler3D inTransmittance; - uniform sampler2D inSceneColor; uniform sampler2D inSceneDepth; @@ -17,11 +14,8 @@ out vec4 FragColor; void main() { vec2 uvs = gl_FragCoord.xy / vec2(textureSize(inSceneDepth, 0)); - vec3 volume_cos = ndc_to_volume(vec3(uvs, texture(inSceneDepth, uvs).r)); - - vec3 scene_color = texture(inSceneColor, uvs).rgb; - vec3 scattering = texture(inScattering, volume_cos).rgb; - vec3 transmittance = texture(inTransmittance, volume_cos).rgb; + vec4 scene_color = texture(inSceneColor, uvs); + float scene_depth = texture(inSceneDepth, uvs).r; - FragColor = vec4(scene_color * transmittance + scattering, 1.0); + FragColor = volumetric_resolve(scene_color, uvs, scene_depth); } |