renderer render

This commit is contained in:
Jérôme Bousquié
2026-07-05 08:00:58 +02:00
parent d1b499570a
commit 7cc1fb845f
7 changed files with 142 additions and 29 deletions
+6 -2
View File
@@ -1,20 +1,24 @@
//! # Basic Shader Module
struct VertexInput {
@location(0) position: vec3<f32>,
@location(1) uv: vec2<f32>,
@location(2) color: vec3<f32>,
};
struct VertexOutput {
@builtin(position) clip_position: vec4<f32>,
@location(0) color: vec3<f32>,
};
@vertex
fn vs_main(model: VertexInput) -> VertexOutput {
var out: VertexOutput;
out.clip_position = vec4<f32>(model.position, 1.0);
out.color = model.color; // On transmet la couleur au fragment shader
return out;
}
@fragment
fn fs_main() -> @location(0) vec4<f32> {
return vec4<f32>(1.0, 0.5, 0.2, 1.0); // Couleur orange
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
return vec4<f32>(in.color, 1.0);
}