Files
pke/data/shaders/lit_generic.ps
2026-03-05 01:42:40 +03:00

30 lines
916 B
PostScript

#version 120
varying vec3 v_position;
varying vec3 v_normal;
varying vec2 v_texcoord;
varying vec3 v_finalColor;
uniform vec4 u_customColor;
uniform vec4 u_sunAmbientColor;
uniform sampler2D u_albedoTexture;
void main() {
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
//gl_FragColor = u_customColor * vec4(v_finalColor, 1.0) * texture2D(u_albedoTexture, v_texcoord);
//gl_FragColor = vec4(v_finalColor, 1.0) * texture2D(u_albedoTexture, v_texcoord);
//gl_FragColor = texture2D(u_albedoTexture, v_texcoord);
//gl_FragColor = vec4( v_normal, 1.0 );
//gl_FragColor = texture2D(u_albedoTexture, v_texcoord);
// !!! NO AREF
// vec3 color = texture2D(u_albedoTexture, v_texcoord).rgb * v_finalColor;
vec3 color = texture2D(u_albedoTexture, v_texcoord).rgb;
color = color * ( u_sunAmbientColor.rgb + v_finalColor.x );
color = color + v_finalColor.y;
gl_FragColor = vec4(color.x, color.y, color.z, 1.0);
}