From 6af8b165fe8cbab35721a8797ca85cda454a5ff4 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 6 Jan 2025 18:54:00 +0100 Subject: new network --- client/src/scene_render.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src/scene_render.rs') diff --git a/client/src/scene_render.rs b/client/src/scene_render.rs index f80f6c2..68d0c49 100644 --- a/client/src/scene_render.rs +++ b/client/src/scene_render.rs @@ -5,9 +5,9 @@ use wgpu::{ ColorWrites, CommandEncoder, Device, FragmentState, FrontFace, IndexFormat, LoadOp, MultisampleState, Operations, PipelineCompilationOptions, PipelineLayoutDescriptor, PolygonMode, PrimitiveState, PrimitiveTopology, RenderPassColorAttachment, - RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, StoreOp, TextureFormat, - TextureView, VertexAttribute, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode, - include_wgsl, + RenderPassDescriptor, RenderPipeline, RenderPipelineDescriptor, ShaderStages, StoreOp, + TextureFormat, TextureView, VertexAttribute, VertexBufferLayout, VertexFormat, VertexState, + VertexStepMode, include_wgsl, }; use crate::scene_prepare::RPrefab; @@ -113,7 +113,9 @@ impl ScenePipeline { for ob in scene.objects.values() { if let Some(prefab) = self.prefabs.get(&ob.res) { - for part in &prefab.0 { + for (affine, part) in &prefab.0 { + let affine = affine.to_cols_array().map(|v| v.to_le_bytes()); + rpass.set_push_constants(ShaderStages::VERTEX, 0, affine.as_flattened()); rpass.set_index_buffer(part.index.slice(..), IndexFormat::Uint16); rpass.set_vertex_buffer(0, part.positions.slice(..)); rpass.set_vertex_buffer(1, part.normals.slice(..)); -- cgit v1.2.3-70-g09d2