mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Add transformation matrix for normal vectors
This commit is contained in:
parent
95a2cb4c7d
commit
cc156b43ab
@ -241,12 +241,17 @@ impl Renderer {
|
||||
#[repr(C)]
|
||||
pub struct Uniforms {
|
||||
pub transform: Mat4,
|
||||
pub transform_for_normals: Mat4,
|
||||
}
|
||||
|
||||
impl Default for Uniforms {
|
||||
fn default() -> Self {
|
||||
let transform = default_transform();
|
||||
Self { transform }
|
||||
let transform_for_normals = transform.inverse().transpose();
|
||||
Self {
|
||||
transform,
|
||||
transform_for_normals,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
struct Uniforms {
|
||||
transform: mat4x4<f32>,
|
||||
transform_for_normals: mat4x4<f32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
Loading…
Reference in New Issue
Block a user