mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Address imbris feedback.
Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging.
This commit is contained in:
parent
561e25778a
commit
e44a1cbf46
@ -59,7 +59,7 @@ pub struct CharacterInfo {
|
|||||||
///
|
///
|
||||||
/// TODO: Add information for rivers (currently, we just prerender them on the
|
/// TODO: Add information for rivers (currently, we just prerender them on the
|
||||||
/// server, but this is not a great solution for LoD. The map rendering code is
|
/// server, but this is not a great solution for LoD. The map rendering code is
|
||||||
/// already set up to be able to take advantage of the rivrer rendering being
|
/// already set up to be able to take advantage of the river rendering being
|
||||||
/// split out, but the format is a little complicated for space reasons and it
|
/// split out, but the format is a little complicated for space reasons and it
|
||||||
/// may take some tweaking to get right, so we avoid sending it for now).
|
/// may take some tweaking to get right, so we avoid sending it for now).
|
||||||
///
|
///
|
||||||
|
@ -26,7 +26,7 @@ impl<Context: SubContext<S>, T, S> Typed<Context, Pure<T>, S> for T {
|
|||||||
///
|
///
|
||||||
/// `expr` is the expression being matched on, generally of some enum type `Ty`.
|
/// `expr` is the expression being matched on, generally of some enum type `Ty`.
|
||||||
///
|
///
|
||||||
/// `case` represents the pattenrn match--it will generally be a stsructure with
|
/// `case` represents the pattern match--it will generally be a structure with
|
||||||
/// one field per constructor in `Ty`. The field should contain enough
|
/// one field per constructor in `Ty`. The field should contain enough
|
||||||
/// information to run the match arm for that constructor, given the information
|
/// information to run the match arm for that constructor, given the information
|
||||||
/// contained in the constructor arguments.
|
/// contained in the constructor arguments.
|
||||||
|
@ -1726,7 +1726,10 @@ impl<'a> Widget for SettingsWindow<'a> {
|
|||||||
if let Some(new_val) = ImageSlider::discrete(
|
if let Some(new_val) = ImageSlider::discrete(
|
||||||
self.global_state.settings.graphics.view_distance,
|
self.global_state.settings.graphics.view_distance,
|
||||||
1,
|
1,
|
||||||
65,
|
// FIXME: Move back to 64 once we support multiple texture atlases, or figure out a
|
||||||
|
// way to increase the size of the terrain atlas.
|
||||||
|
30,
|
||||||
|
// 65,
|
||||||
self.imgs.slider_indicator,
|
self.imgs.slider_indicator,
|
||||||
self.imgs.slider,
|
self.imgs.slider,
|
||||||
)
|
)
|
||||||
@ -2061,7 +2064,11 @@ impl<'a> Widget for SettingsWindow<'a> {
|
|||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(state.ids.fluid_mode_text, ui);
|
.set(state.ids.fluid_mode_text, ui);
|
||||||
|
|
||||||
let mode_list = [FluidMode::Cheap, FluidMode::Shiny];
|
// FIXME: Add shiny water back to the UI once we fix the bug on nVidia cards.
|
||||||
|
let mode_list = [
|
||||||
|
FluidMode::Cheap,
|
||||||
|
// FluidMode::Shiny
|
||||||
|
];
|
||||||
let mode_label_list = [
|
let mode_label_list = [
|
||||||
&self
|
&self
|
||||||
.localized_strings
|
.localized_strings
|
||||||
|
@ -10,26 +10,6 @@ type TodoRect = (
|
|||||||
Vec3<i32>,
|
Vec3<i32>,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// `max_size`:
|
|
||||||
///
|
|
||||||
/// `draw_delta`:
|
|
||||||
///
|
|
||||||
/// `greedy_size`:
|
|
||||||
///
|
|
||||||
/// `greedy_size_cross`:
|
|
||||||
///
|
|
||||||
/// `get_light`:
|
|
||||||
///
|
|
||||||
/// `get_color`:
|
|
||||||
///
|
|
||||||
///
|
|
||||||
/// `create_shadow`:
|
|
||||||
/// Create a shadow vertex (used for both shadow and display rendering)
|
|
||||||
/// given its position, normal, and meta information. Note that the position
|
|
||||||
/// received here is relative to `draw_delta`--it still needs to be translated
|
|
||||||
/// to mesh coordinates.
|
|
||||||
///
|
|
||||||
/// `create_opaque`:
|
|
||||||
pub struct GreedyConfig<D, FL, FC, FO, FS, FP> {
|
pub struct GreedyConfig<D, FL, FC, FO, FS, FP> {
|
||||||
pub data: D,
|
pub data: D,
|
||||||
/// The minimum position to mesh, in the coordinate system used
|
/// The minimum position to mesh, in the coordinate system used
|
||||||
@ -46,7 +26,7 @@ pub struct GreedyConfig<D, FL, FC, FO, FS, FP> {
|
|||||||
/// An important exception is during chunk rendering (where vertical faces
|
/// An important exception is during chunk rendering (where vertical faces
|
||||||
/// at chunk boundaries would otherwise be rendered twice, and also
|
/// at chunk boundaries would otherwise be rendered twice, and also
|
||||||
/// force us to use more than 5 bits to represent x and y
|
/// force us to use more than 5 bits to represent x and y
|
||||||
/// positions--though there may be a clever way aruond the latter).
|
/// positions--though there may be a clever way around the latter).
|
||||||
/// Thus, for chunk rendering we set the number of *vertical* planes to
|
/// Thus, for chunk rendering we set the number of *vertical* planes to
|
||||||
/// one less than the chunk size along the x and y dimensions, but keep
|
/// one less than the chunk size along the x and y dimensions, but keep
|
||||||
/// the number of *horizontal* planes large enough to cover the whole
|
/// the number of *horizontal* planes large enough to cover the whole
|
||||||
@ -148,7 +128,7 @@ impl<'a> GreedyMesh<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Perform greedy meshing on a model, separately producing "pure" model
|
/// Perform greedy meshing on a model, separately producing "pure" model
|
||||||
/// data (the opaque mesh, ttogether with atlas positions connecting
|
/// data (the opaque mesh, together with atlas positions connecting
|
||||||
/// each rectangle with texture information), and raw light and color
|
/// each rectangle with texture information), and raw light and color
|
||||||
/// data ready to be used as a texture (accessible with `finalize`).
|
/// data ready to be used as a texture (accessible with `finalize`).
|
||||||
/// Texture data built up within the same greedy mesh will be inserted
|
/// Texture data built up within the same greedy mesh will be inserted
|
||||||
|
@ -398,7 +398,6 @@ impl<'a, V: RectRasterableVol<Vox = Block> + ReadVol + Debug>
|
|||||||
|
|
||||||
let min_bounds = mesh_delta;
|
let min_bounds = mesh_delta;
|
||||||
let bounds = Aabb {
|
let bounds = Aabb {
|
||||||
// NOTE: Casts are safe since lower_bound and upper_bound both fit in a i16.
|
|
||||||
min: min_bounds,
|
min: min_bounds,
|
||||||
max: max_bounds + min_bounds,
|
max: max_bounds + min_bounds,
|
||||||
};
|
};
|
||||||
|
@ -6,20 +6,11 @@ use crate::mesh::greedy::GreedyMesh;
|
|||||||
use core::ops::Range;
|
use core::ops::Range;
|
||||||
use gfx::{
|
use gfx::{
|
||||||
self, gfx_constant_struct_meta, gfx_defines, gfx_impl_struct_meta, gfx_pipeline,
|
self, gfx_constant_struct_meta, gfx_defines, gfx_impl_struct_meta, gfx_pipeline,
|
||||||
gfx_pipeline_inner, gfx_vertex_struct_meta, state::ColorMask,
|
gfx_pipeline_inner, state::ColorMask,
|
||||||
};
|
};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
gfx_defines! {
|
gfx_defines! {
|
||||||
vertex Vertex {
|
|
||||||
pos_norm: u32 = "v_pos_norm",
|
|
||||||
col: u32 = "v_col",
|
|
||||||
// BBBBBBAA
|
|
||||||
// B = Bone
|
|
||||||
// A = AO
|
|
||||||
ao_bone: u8 = "v_ao_bone",
|
|
||||||
}
|
|
||||||
|
|
||||||
constant Locals {
|
constant Locals {
|
||||||
model_mat: [[f32; 4]; 4] = "model_mat",
|
model_mat: [[f32; 4]; 4] = "model_mat",
|
||||||
model_col: [f32; 4] = "model_col",
|
model_col: [f32; 4] = "model_col",
|
||||||
@ -34,7 +25,6 @@ gfx_defines! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pipeline pipe {
|
pipeline pipe {
|
||||||
// vbuf: gfx::VertexBuffer<Vertex> = (),
|
|
||||||
vbuf: gfx::VertexBuffer<<TerrainPipeline as Pipeline>::Vertex> = (),
|
vbuf: gfx::VertexBuffer<<TerrainPipeline as Pipeline>::Vertex> = (),
|
||||||
// abuf: gfx::VertexBuffer<<TerrainPipeline as Pipeline>::Vertex> = (),
|
// abuf: gfx::VertexBuffer<<TerrainPipeline as Pipeline>::Vertex> = (),
|
||||||
col_lights: gfx::TextureSampler<[f32; 4]> = "t_col_light",
|
col_lights: gfx::TextureSampler<[f32; 4]> = "t_col_light",
|
||||||
@ -111,7 +101,7 @@ impl Default for BoneData {
|
|||||||
pub struct FigurePipeline;
|
pub struct FigurePipeline;
|
||||||
|
|
||||||
impl Pipeline for FigurePipeline {
|
impl Pipeline for FigurePipeline {
|
||||||
type Vertex = Vertex;
|
type Vertex = <TerrainPipeline as Pipeline>::Vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FigureModel {
|
pub struct FigureModel {
|
||||||
|
@ -48,6 +48,7 @@ gfx_defines! {
|
|||||||
|
|
||||||
impl Vertex {
|
impl Vertex {
|
||||||
#[allow(clippy::identity_op)] // TODO: Pending review in #587
|
#[allow(clippy::identity_op)] // TODO: Pending review in #587
|
||||||
|
/// NOTE: meta is true when the terrain vertex is touching water.
|
||||||
pub fn new(atlas_pos: Vec2<u16>, pos: Vec3<f32>, norm: Vec3<f32>, meta: bool) -> Self {
|
pub fn new(atlas_pos: Vec2<u16>, pos: Vec3<f32>, norm: Vec3<f32>, meta: bool) -> Self {
|
||||||
const EXTRA_NEG_Z: f32 = 32768.0;
|
const EXTRA_NEG_Z: f32 = 32768.0;
|
||||||
|
|
||||||
|
@ -601,7 +601,7 @@ impl Renderer {
|
|||||||
/// default, and 11 definitely does, so I assume it's natively supported
|
/// default, and 11 definitely does, so I assume it's natively supported
|
||||||
/// by DirectX itself), OpenGL 3.2+, and Metal (done by default). While
|
/// by DirectX itself), OpenGL 3.2+, and Metal (done by default). While
|
||||||
/// there may be some GPUs that don't quite support it correctly, the
|
/// there may be some GPUs that don't quite support it correctly, the
|
||||||
/// impact is relatively small, so there is no reaosn not to enable it where
|
/// impact is relatively small, so there is no reason not to enable it where
|
||||||
/// available.
|
/// available.
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn enable_seamless_cube_maps(device: &mut gfx_backend::Device) {
|
fn enable_seamless_cube_maps(device: &mut gfx_backend::Device) {
|
||||||
|
@ -213,8 +213,8 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
|
|||||||
|
|
||||||
/// NOTE: We deliberately call this function with only the key into the
|
/// NOTE: We deliberately call this function with only the key into the
|
||||||
/// cache, to enforce that the cached state only depends on the key. We
|
/// cache, to enforce that the cached state only depends on the key. We
|
||||||
/// may end up using different from this cache eventually, in which case
|
/// may end up using a mechanism different from this cache eventually,
|
||||||
/// this strategy might change.
|
/// in which case this strategy might change.
|
||||||
fn bone_meshes(
|
fn bone_meshes(
|
||||||
FigureKey { body, extra }: &FigureKey,
|
FigureKey { body, extra }: &FigureKey,
|
||||||
manifest_indicator: &mut ReloadIndicator,
|
manifest_indicator: &mut ReloadIndicator,
|
||||||
@ -1055,7 +1055,7 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
|
|||||||
// NOTE: Cast to u8 is safe because i <= 16.
|
// NOTE: Cast to u8 is safe because i <= 16.
|
||||||
.filter_map(|(i, bm)| bm.as_ref().map(|bm| (i as u8, bm.clone())))
|
.filter_map(|(i, bm)| bm.as_ref().map(|bm| (i as u8, bm.clone())))
|
||||||
.for_each(|(i, (_opaque_mesh, (bounds, vertex_range)))| {
|
.for_each(|(i, (_opaque_mesh, (bounds, vertex_range)))| {
|
||||||
// Update the bone index for all vertices that belong ot this
|
// Update the bone index for all vertices that belong to this
|
||||||
// model.
|
// model.
|
||||||
opaque
|
opaque
|
||||||
.iter_mut(vertex_range)
|
.iter_mut(vertex_range)
|
||||||
@ -1088,7 +1088,7 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
|
|||||||
// able to store data for any figure. So the only reason we would fail
|
// able to store data for any figure. So the only reason we would fail
|
||||||
// here would be if the user's computer could not store a texture large
|
// here would be if the user's computer could not store a texture large
|
||||||
// enough to fit all the LOD models for the figure, not for fundamental
|
// enough to fit all the LOD models for the figure, not for fundamental
|
||||||
// reasonS related to fitting in a u32).
|
// reasons related to fitting in a u32).
|
||||||
//
|
//
|
||||||
// Therefore, these casts are safe.
|
// Therefore, these casts are safe.
|
||||||
vertex_start as u32..opaque.vertices().len() as u32
|
vertex_start as u32..opaque.vertices().len() as u32
|
||||||
|
Loading…
Reference in New Issue
Block a user