From b0022ad17b5dabe3ade561dec3f6413b59ec350d Mon Sep 17 00:00:00 2001 From: Jonas H Date: Thu, 2 Apr 2026 19:57:31 +0200 Subject: [PATCH] gizmo shader --- src/shaders/main.wesl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shaders/main.wesl b/src/shaders/main.wesl index 20d3c28..089e7c3 100644 --- a/src/shaders/main.wesl +++ b/src/shaders/main.wesl @@ -81,6 +81,15 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4 { } } +/// Fragment shader for transform gizmo lines. +/// Outputs `world_normal` directly as the RGB color — the vertex data encodes +/// axis color (X=red, Y=green, Z=blue) in the normal attribute rather than +/// storing a true geometric normal. +@fragment +fn fs_gizmo(in: VertexOutput) -> @location(0) vec4 { + return vec4(in.world_normal, 1.0); +} + @group(1) @binding(0) var heightmap_texture: texture_2d;