yum/demomo

A graphics engine built on wgpu.

git clone https://git.yummers.dev/yum/demomo

yumAdd inverse-transpose model matrix to Transformeac4a61

master
605 B28 linesraw
1module demomo;
2
3public struct Transform {
4  // Model matrix. Converts from object space to world space.
5  public float4x4 model;
6  // Inverse transpose of the model matrix.
7  public float4x4 modelIT;
8}
9
10public struct Camera {
11  // View-projection matrix. Converts from world space to clip space.
12  public column_major float4x4 viewProj;
13  // Camera position in world space.
14  public float3 worldPos;
15};
16
17enum LightKind {
18  None = 0,
19  Directional = 1,
20  Point = 2,
21}
22
23public struct Light {
24  // Position of the light in world space.
25  public float3 worldPos;
26  public float3 color;
27  public uint kind;
28};