diff options
Diffstat (limited to 'client/src/scene_render.rs')
-rw-r--r-- | client/src/scene_render.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs index f6f7dbb..bc9fc52 100644 --- a/client/src/scene_render.rs +++ b/client/src/scene_render.rs @@ -20,9 +20,9 @@ use weareshared::{packets::Resource, resources::Prefab, tree::SceneTree}; use wgpu::{ BindGroupLayout, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingType, BlendState, Color, ColorTargetState, ColorWrites, CommandEncoder, CompareFunction, DepthBiasState, - DepthStencilState, Device, FragmentState, FrontFace, IndexFormat, LoadOp, MultisampleState, - Operations, PipelineCompilationOptions, PipelineLayoutDescriptor, PolygonMode, PrimitiveState, - PrimitiveTopology, PushConstantRange, RenderPassColorAttachment, + DepthStencilState, Device, Face, FragmentState, FrontFace, IndexFormat, LoadOp, + MultisampleState, Operations, PipelineCompilationOptions, PipelineLayoutDescriptor, + PolygonMode, PrimitiveState, PrimitiveTopology, PushConstantRange, RenderPassColorAttachment, RenderPassDepthStencilAttachment, RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, SamplerBindingType, ShaderStages, StencilState, StoreOp, TextureFormat, TextureSampleType, TextureView, TextureViewDimension, VertexAttribute, @@ -118,7 +118,7 @@ impl ScenePipeline { primitive: PrimitiveState { topology: PrimitiveTopology::TriangleList, front_face: FrontFace::Ccw, - cull_mode: None, //Some(Face::Back), + cull_mode: Some(Face::Back), polygon_mode: PolygonMode::Fill, ..Default::default() }, @@ -173,18 +173,18 @@ impl ScenePipeline { for ob in scene.objects.values() { let prefab_projection = projection + * Mat4::from_translation(ob.pos.into()) * Mat4::from_mat3(Mat3::from_euler( EulerRot::YXZ, ob.rot.x, ob.rot.y, ob.rot.z, - )) - * Mat4::from_translation(ob.pos.into()); + )); if let Some(prefab) = prefabs.try_get(ob.res.clone()) { for (affine, part) in &prefab.0 { let part_projection = prefab_projection - * Mat4::from_mat3a(affine.matrix3) - * Mat4::from_translation(affine.translation.into()); + * Mat4::from_translation(affine.translation.into()) + * Mat4::from_mat3a(affine.matrix3); let projection = part_projection.to_cols_array().map(|v| v.to_le_bytes()); rpass.set_bind_group(0, &*part.texture, &[]); |