Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| uniform vec2 targetTexelSize; | |||||
| uniform int spritePerRow; | |||||
| uniform vec2 bokehAnisotropy; | |||||
| uniform sampler2D colorBuffer; | |||||
| uniform sampler2D cocBuffer; | |||||
| /* Scatter pass, calculate a triangle covering the CoC. | |||||
| * We render to a half resolution target with double width so we can | |||||
| * separate near and far fields. We also generate only one triangle per group of 4 pixels | |||||
| * to limit overdraw. */ | |||||
| flat out vec4 color1; | |||||
| flat out vec4 color2; | |||||
| flat out vec4 color3; | |||||
| flat out vec4 color4; | |||||
| flat out vec4 weights; | |||||
| flat out vec4 cocs; | |||||
| flat out vec2 spritepos; | |||||
| flat out float spritesize; | |||||
| /* Load 4 Circle of confusion values. texel_co is centered around the 4 taps. */ | /* Load 4 Circle of confusion values. texel_co is centered around the 4 taps. */ | ||||
| vec4 fetch_cocs(vec2 texel_co) | vec4 fetch_cocs(vec2 texel_co) | ||||
| { | { | ||||
| /* TODO(@fclem): The `textureGather(sampler, co, comp)` variant isn't here on some | /* TODO(@fclem): The `textureGather(sampler, co, comp)` variant isn't here on some | ||||
| * implementations. | * implementations. | ||||
| */ | */ | ||||
| #if 0 // GPU_ARB_texture_gather | #if 0 // GPU_ARB_texture_gather | ||||
| vec2 uvs = texel_co / vec2(textureSize(cocBuffer, 0)); | vec2 uvs = texel_co / vec2(textureSize(cocBuffer, 0)); | ||||
| ▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines | |||||