blob: 59222b588a0804e277e56d81d976434ebef9d764 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_common_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_cavity_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_curvature_lib.glsl)
void main()
{
float cavity = 0.0, edges = 0.0, curvature = 0.0;
#ifdef USE_CAVITY
cavity_compute(uvcoordsvar.st, depthBuffer, normalBuffer, cavity, edges);
#endif
#ifdef USE_CURVATURE
curvature_compute(uvcoordsvar.st, objectIdBuffer, normalBuffer, curvature);
#endif
float final_cavity_factor = clamp((1.0 - cavity) * (1.0 + edges) * (1.0 + curvature), 0.0, 4.0);
fragColor.rgb = vec3(final_cavity_factor);
fragColor.a = 1.0;
}
|