Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
| /** | /** | ||||
| * Tile flatten pass: Takes the halfres CoC buffer and converts it to 8x8 tiles. | * Tile flatten pass: Takes the halfres CoC buffer and converts it to 8x8 tiles. | ||||
| * | * | ||||
| * Output min and max values for each tile and for both foreground & background. | * Output min and max values for each tile and for both foreground & background. | ||||
| * Also outputs min intersectable CoC for the background, which is the minimum CoC | * Also outputs min intersectable CoC for the background, which is the minimum CoC | ||||
| * that comes from the background pixels. | * that comes from the background pixels. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| /* Half resolution. */ | |||||
| uniform sampler2D halfResCocBuffer; | |||||
| /* 1/8th of halfResCocBuffer resolution. So 1/16th of fullres. */ | |||||
| layout(location = 0) out vec4 outFgCoc; | |||||
| layout(location = 1) out vec3 outBgCoc; | |||||
| const int halfres_tile_divisor = DOF_TILE_DIVISOR / 2; | const int halfres_tile_divisor = DOF_TILE_DIVISOR / 2; | ||||
| void main() | void main() | ||||
| { | { | ||||
| ivec2 halfres_bounds = textureSize(halfResCocBuffer, 0).xy - 1; | ivec2 halfres_bounds = textureSize(halfResCocBuffer, 0).xy - 1; | ||||
| ivec2 tile_co = ivec2(gl_FragCoord.xy); | ivec2 tile_co = ivec2(gl_FragCoord.xy); | ||||
| CocTile tile = dof_coc_tile_init(); | CocTile tile = dof_coc_tile_init(); | ||||
| Show All 31 Lines | |||||