pub struct Context {
pub color_clear: Option<Color4>,
pub depth_clear: Option<f32>,
pub face_cull: Option<FaceCull>,
pub depth_sort: Option<DepthSort>,
pub depth_test: Option<Ordering>,
pub color_write: bool,
pub depth_write: bool,
pub stats: RefCell<Stats>,
}Expand description
Context and parameters used by the renderer.
Fields§
§color_clear: Option<Color4>The color with which to fill the color buffer to clear it, if any.
If rendered geometry always fills the entire frame, color_clear
can be set to None.
depth_clear: Option<f32>The value with which to fill the depth buffer to clear it, if any.
face_cull: Option<FaceCull>Whether to cull (discard) faces pointing either away from or towards the camera. If all geometry drawn is “solid” meshes without holes, backfaces can usually be culled because they are always occluded by frontfaces and drawing them would be useless.
depth_sort: Option<DepthSort>Whether to sort visible faces by their depth. This is important when rendering overlapping transparent faces, which have to be drawn back-to-front to get correct results. On the other hand, rendering nontransparent geometry in front-to-back order can improve performance by reducing overdraw.
depth_test: Option<Ordering>Whether to do depth testing and which predicate to use. If set to
Some(Ordering::Less), a fragment passes the depth test iff
new_z < old_z (the default). If set to None, depth test is not
performed. This setting has no effect if the render target does not
support z-buffering.
color_write: boolWhether to write color values. If false, other fragment processing
is done but there is no color output. This setting has no effect if
the render target does not support color writes.
depth_write: boolWhether to write depth values. If false, other fragment processing
is done but there is no depth output. This setting has no effect if
the render target does not support depth writes.
stats: RefCell<Stats>Collecting rendering statistics.