init
This commit is contained in:
15
assets/shaders/dof_prep.frag
Normal file
15
assets/shaders/dof_prep.frag
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 450 core
|
||||
#include "common.glsl"
|
||||
#include "dof_common.glsl"
|
||||
// Half-res: downsampled color + signed circle of confusion (near < 0 < far).
|
||||
|
||||
in vec2 vUV;
|
||||
layout(binding = 0) uniform sampler2D uColor;
|
||||
layout(binding = 1) uniform sampler2D uDepth;
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec3 c = texture(uColor, vUV).rgb; // bilinear = 2x2 box at half res
|
||||
float coc = cocFromDepth(linearDepth(texture(uDepth, vUV).r), vUV);
|
||||
fragColor = vec4(c, coc);
|
||||
}
|
||||
Reference in New Issue
Block a user