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

workbench_object_outline_lib.glsl « shaders « workbench « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a4a5d9c31a382b208bcabc97ea30964b8a8833e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#define OBJECT_OUTLINE_OFFSET 1

float calculate_object_outline(usampler2D objectId, ivec2 texel, uint object_id)
{
  uvec4 oid_offset = uvec4(
      texelFetchOffset(objectId, texel, 0, ivec2(0, OBJECT_OUTLINE_OFFSET)).r,
      texelFetchOffset(objectId, texel, 0, ivec2(0, -OBJECT_OUTLINE_OFFSET)).r,
      texelFetchOffset(objectId, texel, 0, ivec2(-OBJECT_OUTLINE_OFFSET, 0)).r,
      texelFetchOffset(objectId, texel, 0, ivec2(OBJECT_OUTLINE_OFFSET, 0)).r);

  return dot(vec4(equal(uvec4(object_id), oid_offset)), vec4(0.25));
}