Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/effect_gtao_frag.glsl
| #pragma BLENDER_REQUIRE(common_view_lib.glsl) | #pragma BLENDER_REQUIRE(common_view_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_math_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_geom_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(ambient_occlusion_lib.glsl) | #pragma BLENDER_REQUIRE(ambient_occlusion_lib.glsl) | ||||
| /** | /** | ||||
| * This shader only compute maximum horizon angles for each directions. | * This shader only compute maximum horizon angles for each directions. | ||||
| * The final integration is done at the resolve stage with the shading normal. | * The final integration is done at the resolve stage with the shading normal. | ||||
| */ | */ | ||||
| in vec4 uvcoordsvar; | |||||
| out vec4 FragColor; | |||||
| uniform sampler2D normalBuffer; | |||||
| /* Similar to https://atyuwen.github.io/posts/normal-reconstruction/. | /* Similar to https://atyuwen.github.io/posts/normal-reconstruction/. | ||||
| * This samples the depth buffer 4 time for each direction to get the most correct | * This samples the depth buffer 4 time for each direction to get the most correct | ||||
| * implicit normal reconstruction out of the depth buffer. */ | * implicit normal reconstruction out of the depth buffer. */ | ||||
| vec3 view_position_derivative_from_depth(vec2 uvs, vec2 ofs, vec3 vP, float depth_center) | vec3 view_position_derivative_from_depth(vec2 uvs, vec2 ofs, vec3 vP, float depth_center) | ||||
| { | { | ||||
| vec2 uv1 = uvs - ofs * 2.0; | vec2 uv1 = uvs - ofs * 2.0; | ||||
| vec2 uv2 = uvs - ofs; | vec2 uv2 = uvs - ofs; | ||||
| vec2 uv3 = uvs + ofs; | vec2 uv3 = uvs + ofs; | ||||
| ▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines | |||||