mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed cheap shader
This commit is contained in:
parent
16a175abe0
commit
d7385fd99b
@ -48,9 +48,9 @@ void main() {
|
||||
vec4 clouds;
|
||||
vec3 fog_color = get_sky_color(normalize(f_pos - cam_pos.xyz), time_of_day.x, cam_pos.xyz, f_pos, 0.25, true, clouds);
|
||||
|
||||
float passthrough = pow(dot(faceforward(f_norm, f_norm, cam_to_frag), -cam_to_frag), 0.5);
|
||||
float passthrough = dot(faceforward(f_norm, f_norm, cam_to_frag), -cam_to_frag);
|
||||
|
||||
vec4 color = mix(vec4(surf_color, 1.0), vec4(surf_color, 1.0 / (1.0 + diffuse_light * 0.25)), passthrough);
|
||||
vec4 color = mix(vec4(surf_color, 1.0), vec4(surf_color, 1.0 / (1.0 + diffuse_light)), passthrough);
|
||||
|
||||
tgt_color = mix(mix(color, vec4(fog_color, 0.0), fog_level), vec4(clouds.rgb, 0.0), clouds.a);
|
||||
tgt_color = mix(color, vec4(fog_color, 0.0), 0.0);
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ void main() {
|
||||
vec3 point_light = light_at(f_pos, norm);
|
||||
light += point_light;
|
||||
diffuse_light += point_light;
|
||||
vec3 surf_color = srgb_to_linear(vec3(0.1)) * light * diffuse_light * ambient_light;
|
||||
|
||||
float fog_level = fog(f_pos.xyz, focus_pos.xyz, medium.x);
|
||||
vec4 clouds;
|
||||
@ -117,11 +116,11 @@ void main() {
|
||||
vec4 _clouds;
|
||||
vec3 reflect_color = get_sky_color(reflect_ray_dir, time_of_day.x, f_pos, vec3(-100000), 0.25, false, _clouds) * f_light;
|
||||
// Tint
|
||||
reflect_color = mix(reflect_color, surf_color, 0.6);
|
||||
reflect_color = reflect_color * 0.5 * (diffuse_light + ambient_light);
|
||||
// 0 = 100% reflection, 1 = translucent water
|
||||
float passthrough = pow(dot(faceforward(f_norm, f_norm, cam_to_frag), -cam_to_frag), 1.0);
|
||||
float passthrough = dot(faceforward(f_norm, f_norm, cam_to_frag), -cam_to_frag);
|
||||
|
||||
vec4 color = mix(vec4(reflect_color, 1.0), vec4(surf_color, 1.0 / (1.0 + diffuse_light * 0.25)), passthrough);
|
||||
vec4 color = mix(vec4(reflect_color, 1.0), vec4(vec3(0), 1.0 / (1.0 + diffuse_light * 0.25)), passthrough);
|
||||
|
||||
tgt_color = mix(mix(color, vec4(fog_color, 0.0), fog_level), vec4(clouds.rgb, 0.0), clouds.a);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user