mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix for translucency blocking clouds
This commit is contained in:
parent
d2d4ca33c9
commit
31b9cd0565
@ -70,7 +70,13 @@ void main() {
|
|||||||
vec3 dir = (wpos - cam_pos.xyz) / dist;
|
vec3 dir = (wpos - cam_pos.xyz) / dist;
|
||||||
|
|
||||||
// Apply clouds
|
// Apply clouds
|
||||||
color.rgb = get_cloud_color(color.rgb, dir, cam_pos.xyz, time_of_day.x, dist, 1.0);
|
float cloud_blend = 1.0;
|
||||||
|
if (color.a < 1.0) {
|
||||||
|
cloud_blend = 1.0 - color.a;
|
||||||
|
dist = 50000;
|
||||||
|
}
|
||||||
|
color.rgb = mix(color.rgb, get_cloud_color(color.rgb, dir, cam_pos.xyz, time_of_day.x, dist, 1.0), cloud_blend);
|
||||||
|
|
||||||
#if (CLOUD_MODE == CLOUD_MODE_NONE)
|
#if (CLOUD_MODE == CLOUD_MODE_NONE)
|
||||||
color.rgb = apply_point_glow(cam_pos.xyz + focus_off.xyz, dir, dist, color.rgb);
|
color.rgb = apply_point_glow(cam_pos.xyz + focus_off.xyz, dir, dist, color.rgb);
|
||||||
#endif
|
#endif
|
||||||
|
@ -272,7 +272,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Underwater light attenuation
|
// Underwater light attenuation
|
||||||
surf_color.rgb = water_diffuse(surf_color.rgb, dir, max_dist);
|
surf_color = water_diffuse(surf_color, dir, max_dist);
|
||||||
|
|
||||||
// Apply point glow
|
// Apply point glow
|
||||||
surf_color = apply_point_glow(origin, dir, max_dist, surf_color);
|
surf_color = apply_point_glow(origin, dir, max_dist, surf_color);
|
||||||
|
@ -98,7 +98,14 @@ impl SkyboxPipeline {
|
|||||||
entry_point: "main",
|
entry_point: "main",
|
||||||
targets: &[wgpu::ColorTargetState {
|
targets: &[wgpu::ColorTargetState {
|
||||||
format: wgpu::TextureFormat::Rgba16Float,
|
format: wgpu::TextureFormat::Rgba16Float,
|
||||||
blend: None,
|
blend: Some(wgpu::BlendState {
|
||||||
|
color: wgpu::BlendComponent::REPLACE,
|
||||||
|
alpha: wgpu::BlendComponent {
|
||||||
|
src_factor: wgpu::BlendFactor::Zero,
|
||||||
|
dst_factor: wgpu::BlendFactor::One,
|
||||||
|
operation: wgpu::BlendOperation::Add,
|
||||||
|
},
|
||||||
|
}),
|
||||||
write_mask: wgpu::ColorWrite::ALL,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user