Skip to content

CF_RenderState

Category: graphics
GitHub: cute_graphics.h


A bag of rendering related settings.

Struct Members Description
CF_PrimitiveType primitive_type The type of primitive to draw, as in triangles or lines (triangle list by default). See CF_PrimitiveType.
CF_CullMode cull_mode Controls whether or not to cull triangles based on their winding order. See CF_CullMode.
CF_BlendState blend Controls how the GPU blends pixels together during compositing. See CF_BlendState.
CF_CompareFunction depth_compare Defines how to perform depth-testing. See CF_CompareFunction.
bool depth_write_enabled Must be true to enable depth-testing and use of the depth buffer.
CF_StencilParams stencil Sets up how to perform (if at all) stencil testing. See CF_StencilParams.
float depth_bias_constant_factor A scalar factor controlling the depth value added to each fragment.
float depth_bias_clamp The maximum depth bias of a fragment.
float depth_bias_slope_factor A scalar factor applied to a fragment's slope in depth calculations.
bool enable_depth_bias True to bias fragment depth values.
bool enable_depth_clip True to enable depth clip, false to enable depth clamp.

Remarks

The CF_RenderState is a big collection of various rendering settings, such as culling mode, blending operations, depth and stencil settings, etc. Altering these on a material always means increasing your draw call count. It's best to try and set these once and leave them alone, though this is not always possible.

CF_BlendState
CF_CullMode
CF_StencilParams
cf_material_set_render_state