Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl
| /** | /** | ||||
| * Bokeh Look Up Table: This outputs a radius multiplier to shape the sampling in gather pass or | * Bokeh Look Up Table: This outputs a radius multiplier to shape the sampling in gather pass or | ||||
| * the scatter sprite appearance. This is only used if bokeh shape is either anamorphic or is not | * the scatter sprite appearance. This is only used if bokeh shape is either anamorphic or is not | ||||
| * a perfect circle. | * a perfect circle. | ||||
| * We correct samples spacing for polygonal bokeh shapes. However, we do not for anamorphic bokeh | * We correct samples spacing for polygonal bokeh shapes. However, we do not for anamorphic bokeh | ||||
| * as it is way more complex and expensive to do. | * as it is way more complex and expensive to do. | ||||
| */ | */ | ||||
| #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | #pragma BLENDER_REQUIRE(effect_dof_lib.glsl) | ||||
| uniform float bokehSides; | |||||
| uniform float bokehRotation; | |||||
| uniform vec2 bokehAnisotropyInv; | |||||
| in vec4 uvcoordsvar; | |||||
| layout(location = 0) out vec2 outGatherLut; | |||||
| layout(location = 1) out float outScatterLut; | |||||
| layout(location = 2) out float outResolveLut; | |||||
| float polygon_sides_length(float sides_count) | float polygon_sides_length(float sides_count) | ||||
| { | { | ||||
| return 2.0 * sin(M_PI / sides_count); | return 2.0 * sin(M_PI / sides_count); | ||||
| } | } | ||||
| /* Returns intersection ratio between the radius edge at theta and the polygon edge. | /* Returns intersection ratio between the radius edge at theta and the polygon edge. | ||||
| * Start first corners at theta == 0. */ | * Start first corners at theta == 0. */ | ||||
| float circle_to_polygon_radius(float sides_count, float theta) | float circle_to_polygon_radius(float sides_count, float theta) | ||||
| ▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines | |||||