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

object_camera_image_frag.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7804ebdb8c90b316a873cd69576f2a756247b14b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
in vec2 texCoord_interp;
out vec4 fragColor;

uniform sampler2D image;
uniform float alpha;
uniform bool imagePremultiplied;

void main()
{
#ifdef DRW_STATE_DO_COLOR_MANAGEMENT
  /* render engine has already applied the view transform. We sample the
   * camera images as srgb*/
  vec4 color = texture_read_as_srgb(image, imagePremultiplied, texCoord_interp);

#else
  /* Render engine renders in linearrgb. We sample the camera images as
   * linearrgb */
  vec4 color = texture_read_as_linearrgb(image, imagePremultiplied, texCoord_interp);
#endif

  color.a *= alpha;
  color.rgb *= color.a;

  fragColor = color;
}