Welcome to mirror list, hosted at ThFree Co, Russian Federation.

image_engine_depth_frag.glsl « shaders « image « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88610fb97fda972870a0eeb579cef38f471acb46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma BLENDER_REQUIRE(common_colormanagement_lib.glsl)

#define Z_DEPTH_BORDER 1.0
#define Z_DEPTH_IMAGE 0.75

bool is_border(vec2 uv)
{
  return (uv.x < min_max_uv.x || uv.y < min_max_uv.y || uv.x >= min_max_uv.z ||
          uv.y >= min_max_uv.w);
}

void main()
{
  bool border = is_border(uv_image);
  gl_FragDepth = border ? Z_DEPTH_BORDER : Z_DEPTH_IMAGE;
}