init
This commit is contained in:
17
assets/shaders/dof_composite.frag
Normal file
17
assets/shaders/dof_composite.frag
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 450 core
|
||||
#include "common.glsl"
|
||||
#include "dof_common.glsl"
|
||||
|
||||
in vec2 vUV;
|
||||
layout(binding = 0) uniform sampler2D uSharp;
|
||||
layout(binding = 1) uniform sampler2D uBlurred;
|
||||
layout(binding = 2) uniform sampler2D uDepth;
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec3 sharp = texture(uSharp, vUV).rgb;
|
||||
vec4 blurred = texture(uBlurred, vUV);
|
||||
float coc = abs(cocFromDepth(linearDepth(texture(uDepth, vUV).r), vUV));
|
||||
float m = smoothstep(0.02, 0.35, max(coc, blurred.a));
|
||||
fragColor = vec4(mix(sharp, blurred.rgb, m), 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user