jucraft/assets/shader/default.fsh.glsl

20 lines
454 B
Text
Raw Normal View History

2023-04-18 14:17:53 +02:00
#version 100
precision mediump float;
varying vec2 texcoord;
varying float v_position;
uniform sampler2D u_image0;
uniform sampler2D u_image1;
uniform vec2 fog;
void main() {
float fogAmount = smoothstep(fog.x, fog.y, v_position);
gl_FragColor =
texture2D(u_image0, texcoord)
* texture2D(u_image1, texcoord)
* vec4(1.0 - fogAmount, 1.0 - fogAmount, 1.0 - fogAmount, 1.0 - fogAmount);
if(gl_FragColor.a < 0.0000001)
discard;
}