1#import bevy_pbr::mesh_view_bindings::view 2#import bevy_pbr::mesh_functions::get_world_from_local 4#import bevy_pbr::forward_io::Vertex 7 @builtin(position) clip_position: vec4<f32>, 8 @location(0) height: f32, 12fn vertex(vertex: Vertex) -> VertexOutput { 13 var out: VertexOutput; 14 let model_matrix = get_world_from_local(vertex.instance_index); 15 let world_position = model_matrix * vec4<f32>(vertex.position, 1.0); 17 out.clip_position = view.clip_from_world * world_position; 19 out.height = vertex.position.y; 24struct HeightSettings { 30var<uniform> settings: HeightSettings; 33fn fragment(in: VertexOutput) -> @location(0) vec4<f32> { 34 let span = settings.max_height - settings.min_height; 37 return vec4<f32>(0.0, 0.0, 0.0, 1.0); 40 let normalized_height = (in.height - settings.min_height) / span; 42 return vec4<f32>(normalized_height, 0.0, 0.0, 1.0);