Differential D16243 Diff 58431 source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl
| /** | /** | ||||
| * Scatter pass: Use sprites to scatter the color of very bright pixel to have higher quality blur. | * Scatter pass: Use sprites to scatter the color of very bright pixel to have higher quality blur. | ||||
| * | * | ||||
| * We only scatter one triangle per sprite and one sprite per 4 pixels to reduce vertex shader | * We only scatter one triangle per sprite and one sprite per 4 pixels to reduce vertex shader | ||||
| * invocations and overdraw. | * invocations and overdraw. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| uniform sampler2D occlusionBuffer; | |||||
| uniform sampler2D bokehLut; | |||||
| uniform vec2 bokehAnisotropyInv; | |||||
| flat in vec4 color1; | |||||
| flat in vec4 color2; | |||||
| flat in vec4 color3; | |||||
| flat in vec4 color4; | |||||
| flat in vec4 weights; | |||||
| flat in vec4 cocs; | |||||
| flat in vec2 spritepos; | |||||
| flat in float spritesize; /* MaxCoC */ | |||||
| layout(location = 0) out vec4 fragColor; | |||||
| float bokeh_shape(vec2 center) | float bokeh_shape(vec2 center) | ||||
| { | { | ||||
| vec2 co = gl_FragCoord.xy - center; | vec2 co = gl_FragCoord.xy - center; | ||||
| #ifdef DOF_BOKEH_TEXTURE | #ifdef DOF_BOKEH_TEXTURE | ||||
| co *= bokehAnisotropyInv; | co *= bokehAnisotropyInv; | ||||
| float texture_size = float(textureSize(bokehLut, 0).x); | float texture_size = float(textureSize(bokehLut, 0).x); | ||||
| /* Bias scale to avoid sampling at the texture's border. */ | /* Bias scale to avoid sampling at the texture's border. */ | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||