This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/object_empty_image_frag.glsl

34 lines
510 B
GLSL
Raw Normal View History

2017-05-20 22:57:47 +10:00
flat in vec4 finalColor;
#ifndef USE_WIRE
in vec2 texCoord_interp;
#endif
out vec4 fragColor;
#ifndef USE_WIRE
uniform sampler2D image;
#endif
uniform int depthMode;
2017-05-20 22:57:47 +10:00
void main()
{
#ifdef USE_WIRE
fragColor = finalColor;
#else
fragColor = finalColor * texture(image, texCoord_interp);
#endif
if (depthMode == DEPTH_BACK) {
gl_FragDepth = 0.999999;
}
else if (depthMode == DEPTH_FRONT) {
gl_FragDepth = 0.000001;
}
else if (depthMode == DEPTH_UNCHANGED) {
gl_FragDepth = gl_FragCoord.z;
}
2017-05-20 22:57:47 +10:00
}