mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed shader compilation error
This commit is contained in:
parent
e6332c1cb5
commit
a316a780fc
@ -73,7 +73,7 @@ void main() {
|
|||||||
#if (CLOUD_MODE != CLOUD_MODE_NONE)
|
#if (CLOUD_MODE != CLOUD_MODE_NONE)
|
||||||
color.rgb = get_cloud_color(color.rgb, dir, cam_pos.xyz, time_of_day.x, dist, 1.0);
|
color.rgb = get_cloud_color(color.rgb, dir, cam_pos.xyz, time_of_day.x, dist, 1.0);
|
||||||
#else
|
#else
|
||||||
color.rgb = apply_point_glow(cam_pos.xyz + focus_off.xyz, dir, dist, color.rgb, BLOOM_FACTOR);
|
color.rgb = apply_point_glow(cam_pos.xyz + focus_off.xyz, dir, dist, color.rgb);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tgt_color = vec4(color.rgb, 1);
|
tgt_color = vec4(color.rgb, 1);
|
||||||
|
@ -271,11 +271,12 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Underwater light attenuation
|
||||||
if (medium.x == 1) {
|
if (medium.x == 1) {
|
||||||
float f_alt = alt_at(cam_pos.xy);
|
float f_alt = alt_at(cam_pos.xy);
|
||||||
float fluid_alt = max(cam_pos.z + 1, floor(f_alt + 1));
|
float fluid_alt = max(cam_pos.z + 1, floor(f_alt + 1));
|
||||||
|
|
||||||
float water_dist = clamp((fluid_alt - cam_pos.z) / max(dir.z, 0), 0, max_dist);
|
float water_dist = clamp((fluid_alt - cam_pos.z) / pow(max(dir.z, 0), 10), 0, max_dist);
|
||||||
|
|
||||||
//float fade = 1.0 - clamp(water_dist * 0.01, 0, 1);//pow(0.97, water_dist);
|
//float fade = 1.0 - clamp(water_dist * 0.01, 0, 1);//pow(0.97, water_dist);
|
||||||
float fade = pow(0.98, water_dist);
|
float fade = pow(0.98, water_dist);
|
||||||
|
Loading…
Reference in New Issue
Block a user