35 lines
677 B
WebGPU Shading Language
35 lines
677 B
WebGPU Shading Language
struct CameraUniform {
|
|
eye: vec4<f32>;
|
|
vp: mat4x4<f32>;
|
|
};
|
|
|
|
struct MeshInstance {
|
|
transform: mat4x4<f32>;
|
|
};
|
|
|
|
struct MeshData {
|
|
instances: array<MeshInstance>;
|
|
};
|
|
|
|
struct PointLight {
|
|
center: vec4<f32>;
|
|
intensity: vec4<f32>;
|
|
};
|
|
|
|
struct PointLightData {
|
|
num: i32;
|
|
lights: array<PointLight>;
|
|
};
|
|
|
|
struct VertexInput {
|
|
[[location(0)]] position: vec3<f32>;
|
|
[[location(1)]] normal: vec3<f32>;
|
|
[[location(2)]] tex_coords: vec2<f32>;
|
|
};
|
|
|
|
struct VertexOutput {
|
|
[[builtin(position)]] clip_position: vec4<f32>;
|
|
[[location(0)]] position: vec3<f32>;
|
|
[[location(1)]] normal: vec3<f32>;
|
|
[[location(2)]] tex_coords: vec2<f32>;
|
|
}; |