SCATTER_VERTEX_SHADER

Constant SCATTER_VERTEX_SHADER 

Source
pub const SCATTER_VERTEX_SHADER: &str = r#"
struct VertexInput {
    @location(0) position: vec2<f32>,
    @location(1) color: vec4<f32>,
    @location(2) size: f32,
}

struct VertexOutput {
    @builtin(position) clip_position: vec4<f32>,
    @location(0) color: vec4<f32>,
    @location(1) point_coord: vec2<f32>,
}

@vertex
fn vs_main(vertex: VertexInput) -> VertexOutput {
    var out: VertexOutput;
    out.clip_position = vec4<f32>(vertex.position, 0.0, 1.0);
    out.color = vertex.color;
    out.point_coord = vec2<f32>(0.0, 0.0); // Will be set in geometry shader alternative
    return out;
}
"#;
Expand description

Vertex shader for scatter plots (advanced, with circular point support)

This shader prepares point data for rendering circles. The point_coord will be used by the fragment shader to create smooth circular points.

Note: Currently not used - requires geometry shader or point sprite setup.