Doodle3D-Core/shaders/fragmentShaderCombineTextures.glsl

17 lines
544 B
Plaintext
Raw Normal View History

2017-10-24 12:33:14 +02:00
uniform sampler2D tDiffuse;
uniform sampler2D tNormal;
uniform sampler2D tDepth;
uniform sampler2D tUI;
varying vec2 vUv;
void main() {
vec4 colorDiffuse = texture2D(tDiffuse, vUv); // cell shader
vec4 colorNormal = texture2D(tNormal, vUv); // outline from normal texture
colorNormal.w = 0.0;
vec4 colorDepth = texture2D(tDepth, vUv); // outline from depth texture
colorDepth.w = 0.0;
vec4 colorUI = texture2D(tUI, vUv); // color ui's
gl_FragColor = mix(max(colorDiffuse - colorDepth - colorNormal, 0.0), colorUI, colorUI.w);
}