mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Some minor changes.
This commit is contained in:
parent
4e02024670
commit
ccc6a06a8d
@ -281,7 +281,7 @@ void main() {
|
||||
// diffuse_light += point_light;
|
||||
// reflected_light += point_light;
|
||||
// vec3 surf_color = srgb_to_linear(vec3(0.2, 0.5, 1.0)) * light * diffuse_light * ambient_light;
|
||||
vec3 surf_color = illuminate(max_light, view_dir, emitted_light/* * log(1.0 - MU_WATER)*/, /*cam_attenuation * *//*water_color * */reflected_light/* * log(1.0 - MU_WATER)*/);
|
||||
vec3 surf_color = illuminate(max_light, view_dir, emitted_light/* * log(1.0 - MU_WATER)*/, /*cam_attenuation * *//*water_color * */reflect_color * reflected_light/* * log(1.0 - MU_WATER)*/);
|
||||
|
||||
// passthrough = pow(passthrough, 1.0 / (1.0 + water_depth_to_camera));
|
||||
/* surf_color = cam_attenuation.g < 0.5 ?
|
||||
|
@ -45,6 +45,7 @@ vec2 cloud_at(vec3 pos) {
|
||||
vec4 get_cloud_color(vec3 dir, vec3 origin, float time_of_day, float max_dist, float quality) {
|
||||
const int ITERS = 12;
|
||||
const float INCR = 1.0 / ITERS;
|
||||
origin = origin + focus_off.xyz;
|
||||
|
||||
vec3 max_heights = get_cloud_heights();
|
||||
float mind = (max_heights.y - origin.z) / dir.z;
|
||||
|
@ -440,32 +440,6 @@ impl FigureMgr {
|
||||
.map(|i| (Pos(i.pos), *i.ori))
|
||||
.unwrap_or((*pos, Vec3::unit_y()));
|
||||
|
||||
// Don't display figures outside the frustum spectrum (this is important to do
|
||||
// for any figure that potentially casts a shadow, since we use this
|
||||
// to estimate bounds for shadow maps). The reason we do this
|
||||
// before the udpate cull is to make sure infrequently updated
|
||||
// figures are not clipped when they're visible; the vd_frac part is
|
||||
// delayed until after that test to limit program pauses from too many
|
||||
// figures being removed at once (rather than their being removed based on their
|
||||
// update rates).
|
||||
let radius = scale.unwrap_or(&Scale(1.0)).0 * 2.0;
|
||||
let (in_frustum, lpindex) = if let Some(mut meta) = self.states.get_mut(body, &entity) {
|
||||
let (in_frustum, lpindex) = BoundingSphere::new(pos.0.into_array(), radius)
|
||||
.coherent_test_against_frustum(frustum, meta.lpindex);
|
||||
meta.visible = in_frustum;
|
||||
meta.lpindex = lpindex;
|
||||
(in_frustum, lpindex)
|
||||
} else {
|
||||
(true, 0)
|
||||
};
|
||||
if in_frustum {
|
||||
// Update visible bounds.
|
||||
visible_aabb.expand_to_contain(Aabb {
|
||||
min: pos.0 - radius,
|
||||
max: pos.0 + radius,
|
||||
});
|
||||
}
|
||||
|
||||
// Maintaining figure data and sending new figure data to the GPU turns out to
|
||||
// be a very expensive operation. We want to avoid doing it as much
|
||||
// as possible, so we make the assumption that players don't care so
|
||||
@ -502,6 +476,29 @@ impl FigureMgr {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Don't display figures outside the frustum spectrum (this is important to do
|
||||
// for any figure that potentially casts a shadow, since we use this
|
||||
// to estimate bounds for shadow maps). Currently, we don't do this before the update
|
||||
// cull, so it's possible that faraway figures will not shadow correctly until their
|
||||
// next update. For now, we treat this as an acceptable tradeoff.
|
||||
let radius = scale.unwrap_or(&Scale(1.0)).0 * 2.0;
|
||||
let (in_frustum, lpindex) = if let Some(mut meta) = self.states.get_mut(body, &entity) {
|
||||
let (in_frustum, lpindex) = BoundingSphere::new(pos.0.into_array(), radius)
|
||||
.coherent_test_against_frustum(frustum, meta.lpindex);
|
||||
meta.visible = in_frustum;
|
||||
meta.lpindex = lpindex;
|
||||
(in_frustum, lpindex)
|
||||
} else {
|
||||
(true, 0)
|
||||
};
|
||||
if in_frustum {
|
||||
// Update visible bounds.
|
||||
visible_aabb.expand_to_contain(Aabb {
|
||||
min: pos.0 - radius,
|
||||
max: pos.0 + radius,
|
||||
});
|
||||
}
|
||||
|
||||
// Change in health as color!
|
||||
let col = stats
|
||||
.map(|s| {
|
||||
|
Loading…
Reference in New Issue
Block a user