feat: deferred shading (day 2)
This commit is contained in:
@@ -25,8 +25,7 @@ uniform bool u_debugNormals;
|
||||
#include <shadows>
|
||||
|
||||
void main() {
|
||||
float shadow = calc_shadow();
|
||||
vec3 fogColor = texture(u_skybox, a_dir).rgb;
|
||||
//vec3 fogColor = texture(u_skybox, a_dir).rgb;
|
||||
vec4 texColor = texture(u_texture0, a_texCoord);
|
||||
float alpha = texColor.a;
|
||||
if (u_alphaClip) {
|
||||
@@ -43,8 +42,8 @@ void main() {
|
||||
texColor.rgb *= a_normal * 0.5 + 0.5;
|
||||
}
|
||||
f_color = texColor;
|
||||
f_color.rgb *= min(vec3(1.0), a_torchLight.rgb + a_skyLight * shadow);
|
||||
f_color = mix(f_color, vec4(fogColor, 1.0), a_fog);
|
||||
f_color.rgb *= min(vec3(1.0), a_torchLight.rgb + a_skyLight);
|
||||
//f_color = mix(f_color, vec4(fogColor, 1.0), a_fog * 0.0);
|
||||
f_color.a = alpha;
|
||||
f_position = vec4(a_position, 1.0);
|
||||
f_normal = vec4(a_normal, 1.0);
|
||||
|
||||
Reference in New Issue
Block a user