From b68dfa791d85022517bcef12a664b1e8d7e0814a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 1 Sep 2023 15:55:27 -0700 Subject: [PATCH] array + instance_index is not the way --- src/shader.wgsl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shader.wgsl b/src/shader.wgsl index cab173f..e861632 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -78,13 +78,12 @@ var r_EntityTransforms: array; @vertex fn vs_entity( - @builtin(instance_index) instance_index: u32, @location(0) pos: vec3, @location(1) normal: vec3, ) -> EntityOutput { - var position: vec3 = r_EntityTransforms[instance_index].matrix3 * pos+r_EntityTransforms[instance_index].translation; + var position: vec3 = pos;//r_EntityTransforms[instance_index].matrix3 * pos+r_EntityTransforms[instance_index].translation; var result: EntityOutput; - result.normal = r_EntityTransforms[instance_index].matrix3 * normal; + result.normal = normal;//r_EntityTransforms[instance_index].matrix3 * normal; result.view = position - r_data.cam_pos.xyz; result.position = r_data.proj * r_data.view * vec4(position, 1.0); return result;