protot/3rdparty/tinygltf/examples/glview/shader.frag

17 lines
392 B
GLSL
Raw Permalink Normal View History

2018-03-19 23:00:51 +01:00
uniform sampler2D diffuseTex;
uniform int uIsCurve;
varying vec3 normal;
varying vec2 texcoord;
void main(void)
{
//gl_FragColor = vec4(0.5 * normalize(normal) + 0.5, 1.0);
//gl_FragColor = vec4(texcoord, 0.0, 1.0);
if (uIsCurve > 0) {
gl_FragColor = texture2D(diffuseTex, texcoord);
} else {
gl_FragColor = vec4(0.5 * normalize(normal) + 0.5, 1.0);
}
}