Skip to main content

screen_view

Function screen_view 

Source
pub fn screen_view(viewport_points: [f32; 2]) -> Camera
Available on crate feature egui only.
Expand description

A world-to-clip matrix taking egui’s tessellated points to clip space.

egui positions its vertices in logical points with the origin at the top left and Y growing downwards, so the Y coefficient is negated; Z collapses to zero, since everything the UI draws sits at one depth. The physical density never enters: the target’s format already encodes its pixels.

The caller writes this into their camera uniform, since the camera buffer is theirs; screen_viewport is the view to bind beside it.