Differential D16990 Diff 60050 source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_downsample_comp.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_downsample_comp.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. | * Pretty much identical to the setup pass but get CoC from buffer. | ||||
| * Also does not weight luma for the bilateral weights. | * Also does not weight luma for the bilateral weights. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(eevee_depth_of_field_lib.glsl) | #pragma BLENDER_REQUIRE(eevee_depth_of_field_lib.glsl) | ||||
| void main() | void main() | ||||
| { | { | ||||
| vec2 halfres_texel_size = 1.0 / vec2(textureSize(color_tx, 0).xy); | vec2 halfres_texel_size = 1.0 / vec2(textureSize(color_tx, 0).xy); | ||||
| /* Center uv around the 4 halfres pixels. */ | /* Center uv around the 4 halfres pixels. */ | ||||
| vec2 quad_center = vec2(gl_GlobalInvocationID * 2 + 1) * halfres_texel_size; | vec2 quad_center = vec2(gl_GlobalInvocationID.xy * 2 + 1) * halfres_texel_size; | ||||
| vec4 colors[4]; | vec4 colors[4]; | ||||
| vec4 cocs; | vec4 cocs; | ||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| vec2 sample_uv = quad_center + quad_offsets[i] * halfres_texel_size; | vec2 sample_uv = quad_center + quad_offsets[i] * halfres_texel_size; | ||||
| colors[i] = textureLod(color_tx, sample_uv, 0.0); | colors[i] = textureLod(color_tx, sample_uv, 0.0); | ||||
| cocs[i] = textureLod(coc_tx, sample_uv, 0.0).r; | cocs[i] = textureLod(coc_tx, sample_uv, 0.0).r; | ||||
| } | } | ||||
| Show All 9 Lines | |||||