blob: 0798c52e2745f5e60af9bc73a808041b29d0cdd6 (
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 and 3D effects.
#pragma once
#include "util/mini_math.h"
// Camera parameters for SDF raymarching effects and 3D rendering
// 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");
|