Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl
| /** | /** | ||||
| * Gather pass: Convolve foreground and background parts in separate passes. | * Gather pass: Convolve foreground and background parts in separate passes. | ||||
| * | * | ||||
| * Using the min&max CoC tile buffer, we select the best appropriate method to blur the scene | * Using the min&max CoC tile buffer, we select the best appropriate method to blur the scene | ||||
| * color. A fast gather path is taken if there is not many CoC variation inside the tile. | * color. A fast gather path is taken if there is not many CoC variation inside the tile. | ||||
| * | * | ||||
| * We sample using an octaweb sampling pattern. We randomize the kernel center and each ring | * We sample using an octaweb sampling pattern. We randomize the kernel center and each ring | ||||
| * rotation to ensure maximum coverage. | * rotation to ensure maximum coverage. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| /* Mipmapped input buffers, halfres but with padding to ensure mipmap alignment. */ | #ifdef DOF_HOLEFILL_PASS | ||||
| uniform sampler2D colorBuffer; | |||||
| uniform sampler2D cocBuffer; | |||||
| /* Same input buffer but with a bilinear sampler object. */ | |||||
| uniform sampler2D colorBufferBilinear; | |||||
| /* CoC Min&Max tile buffer at 1/16th of fullres. */ | |||||
| uniform sampler2D cocTilesFgBuffer; | |||||
| uniform sampler2D cocTilesBgBuffer; | |||||
| uniform sampler2D bokehLut; | |||||
| /* Used to correct the padding in the color and CoC buffers. */ | |||||
| uniform vec2 gatherInputUvCorrection; | |||||
| uniform vec2 gatherOutputTexelSize; | |||||
| uniform vec2 bokehAnisotropy; | |||||
| layout(location = 0) out vec4 outColor; | |||||
| layout(location = 1) out float outWeight; | |||||
| #ifndef DOF_HOLEFILL_PASS | |||||
| layout(location = 2) out vec2 outOcclusion; | |||||
| #else | |||||
| /* Dirty global variable that isn't used. So it should get optimized out. */ | /* Dirty global variable that isn't used. So it should get optimized out. */ | ||||
| vec2 outOcclusion; | vec2 outOcclusion; | ||||
| #endif | #endif | ||||
| #ifdef DOF_FOREGROUND_PASS | #ifdef DOF_FOREGROUND_PASS | ||||
| const bool is_foreground = true; | const bool is_foreground = true; | ||||
| #else /* DOF_BACKGROUND_PASS */ | #else /* DOF_BACKGROUND_PASS */ | ||||
| const bool is_foreground = false; | const bool is_foreground = false; | ||||
| ▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines | |||||