This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/engines/eevee/shaders/volumetric_resolve_frag.glsl

22 lines
652 B
GLSL

/* Based on Frosbite Unified Volumetric.
* https://www.ea.com/frostbite/news/physically-based-unified-volumetric-rendering-in-frostbite */
/* Step 4 : Apply final integration on top of the scene color.
* Note that we do the blending ourself instead of relying
* on hardware blending which would require 2 pass. */
uniform sampler2D inSceneColor;
uniform sampler2D inSceneDepth;
out vec4 FragColor;
void main()
{
vec2 uvs = gl_FragCoord.xy / vec2(textureSize(inSceneDepth, 0));
vec4 scene_color = texture(inSceneColor, uvs);
float scene_depth = texture(inSceneDepth, uvs).r;
FragColor = volumetric_resolve(scene_color, uvs, scene_depth);
}