mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update advanced shading
This commit is contained in:
parent
9ca0b5154d
commit
771c72324c
1 changed files with 6 additions and 2 deletions
|
|
@ -26,8 +26,12 @@ vec4 effect() {
|
|||
|
||||
float emission = texture(u_emission, v_uv).r;
|
||||
|
||||
float rg = 1.0;
|
||||
#ifdef ENABLE_SHADOWS
|
||||
light *= calc_shadow(modelpos, normal, length(pos));
|
||||
float shadow_mul = calc_shadow(modelpos, normal, length(pos));
|
||||
light *= shadow_mul;
|
||||
rg *= min(1.0, shadow_mul + emission);
|
||||
light *= 2.0;
|
||||
#endif
|
||||
|
||||
light = max(light, emission);
|
||||
|
|
@ -40,5 +44,5 @@ vec4 effect() {
|
|||
mix(1.0, CLOUDS_FOG_FACTOR_MUL, emission),
|
||||
mix(1.0, CLOUDS_FOG_CURVE_MUL, emission)
|
||||
);
|
||||
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);
|
||||
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0) * vec3(rg, 0.5 + rg * 0.5, 1.0), fogColor, fog), 1.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue