Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl
| /** | /** | ||||
| * Downsample pass: CoC aware downsample to quarter resolution. | * Downsample pass: CoC aware downsample to quarter resolution. | ||||
| * | * | ||||
| * Pretty much identical to the setup pass but get CoC from buffer. Also does not | * Pretty much identical to the setup pass but get CoC from buffer. Also does not | ||||
| * weight luma for the bilateral weights. | * weight luma for the bilateral weights. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| /* Half resolution. */ | |||||
| uniform sampler2D colorBuffer; | |||||
| uniform sampler2D cocBuffer; | |||||
| /* Quarter resolution. */ | |||||
| layout(location = 0) out vec4 outColor; | |||||
| void main() | void main() | ||||
| { | { | ||||
| vec2 halfres_texel_size = 1.0 / vec2(textureSize(colorBuffer, 0).xy); | vec2 halfres_texel_size = 1.0 / vec2(textureSize(colorBuffer, 0).xy); | ||||
| /* Center uv around the 4 halfres pixels. */ | /* Center uv around the 4 halfres pixels. */ | ||||
| vec2 quad_center = (floor(gl_FragCoord.xy) * 2.0 + 1.0) * halfres_texel_size; | vec2 quad_center = (floor(gl_FragCoord.xy) * 2.0 + 1.0) * halfres_texel_size; | ||||
| vec4 colors[4]; | vec4 colors[4]; | ||||
| vec4 cocs; | vec4 cocs; | ||||
| Show All 12 Lines | |||||