sgl-3d 0.4.2

Caller-driven 3D rendering for SGL games, native and in the browser (WebGPU)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// The shader provider of a program that composes no game shader
// (shader_contract.wgsl): its functions return their argument, so a
// material without a shader takes SGL3D's one vertex and surface path
// unchanged. A program composes it with shader_inputs_none.wgsl, or a
// game's module with shader_inputs_bound.wgsl.
struct ShaderParams {
 unused:vec4<f32>,
}
fn material_vertex(v:MaterialVertex,ctx:VertexContext,params:ShaderParams)->MaterialVertex {
 return v;
}
fn material_surface(s:MaterialSurface,ctx:SurfaceContext,params:ShaderParams)->MaterialSurface {
 return s;
}