diff --git a/assets/voxygen/shaders/clouds-frag.glsl b/assets/voxygen/shaders/clouds-frag.glsl index fd9a402b76..e148c2595a 100644 --- a/assets/voxygen/shaders/clouds-frag.glsl +++ b/assets/voxygen/shaders/clouds-frag.glsl @@ -53,7 +53,7 @@ float depth_at(vec2 uv) { vec3 wpos_at(vec2 uv) { float buf_depth = texture(sampler2D(t_src_depth, s_src_depth), uv).x * 2.0 - 1.0; mat4 inv = view_mat_inv * proj_mat_inv;//inverse(all_mat); - vec4 clip_space = vec4(uv * 2.0 - 1.0, buf_depth, 1.0); + vec4 clip_space = vec4((uv * 2.0 - 1.0) * vec2(1, -1), buf_depth, 1.0); vec4 view_space = inv * clip_space; view_space /= view_space.w; if (buf_depth == 1.0) { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 62606bb936..0a468f9eda 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -7,8 +7,8 @@ pub use load::load_mesh; // TODO: Don't make this public. use crate::{ ecs::comp::Interpolated, render::{ - pipelines, ColLightInfo, Consts, FigureBoneData, FigureLocals, FigureModel, GlobalModel, - LodData, Mesh, RenderError, Renderer, SubModel, TerrainVertex, Texture, + pipelines, ColLightInfo, FigureBoneData, FigureLocals, FigureModel, FirstPassDrawer, + GlobalModel, LodData, Mesh, RenderError, Renderer, SubModel, TerrainVertex, }, scene::{ camera::{Camera, CameraMode, Dependents}, @@ -63,7 +63,7 @@ pub type CameraData<'a> = (&'a Camera, f32); pub type FigureModelRef<'a> = ( &'a pipelines::figure::BoundLocals, SubModel<'a, TerrainVertex>, - &'a Texture, /* */ + &'a pipelines::figure::ColLights, /* */ ); /// An entry holding enough information to draw or destroy a figure in a @@ -4668,9 +4668,9 @@ impl FigureMgr { } #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 - pub fn render_player( - &self, - renderer: &mut Renderer, + pub fn render_player<'a>( + &'a self, + drawer: &mut FirstPassDrawer<'a>, state: &State, player_entity: EcsEntity, tick: u64, @@ -4709,8 +4709,7 @@ impl FigureMgr { figure_lod_render_distance, |state| state.visible(), ) { - //renderer.render_player(model, &col_lights, global, locals, - // bone_consts, lod); + drawer.draw_figure(model, bound, col_lights); /*renderer.render_player_shadow( model, &col_lights, diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index a5930db6ff..a4a3218f4c 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -1017,15 +1017,15 @@ impl Scene { }*/ let lod = self.lod.get_data(); - /*self.figure_mgr.render_player( - renderer, + self.figure_mgr.render_player( + drawer, state, player_entity, tick, global, lod, camera_data, - );*/ + ); // Render terrain and figures. /*self.terrain.render(renderer, global, lod, focus_pos);