summaryrefslogtreecommitdiff
path: root/src/gpu/camera_params.h
blob: 361f65f45cfee6efe25f078cd0587db4601bbe55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This file is part of the 64k demo project.
// It defines CameraParams for raymarching effects.

#pragma once

#include "util/mini_math.h"

// Camera parameters for SDF raymarching effects
// Binding convention: @group(0) @binding(3)
struct CameraParams {
  mat4 inv_view;      // Inverse view matrix (screen→world transform)
  float fov;          // Vertical field of view in radians
  float near_plane;   // Near clipping plane
  float far_plane;    // Far clipping plane
  float aspect_ratio; // Width/height ratio
};
static_assert(sizeof(CameraParams) == 80,
              "CameraParams must be 80 bytes for WGSL alignment");