Struct glium::draw_parameters::DrawParameters
[−]
[src]
pub struct DrawParameters<'a> { pub depth: Depth, pub stencil: Stencil, pub blend: Blend, pub color_mask: (bool, bool, bool, bool), pub line_width: Option<f32>, pub point_size: Option<f32>, pub backface_culling: BackfaceCullingMode, pub polygon_mode: PolygonMode, pub multisampling: bool, pub dithering: bool, pub viewport: Option<Rect>, pub scissor: Option<Rect>, pub draw_primitives: bool, pub samples_passed_query: Option<SamplesQueryParam<'a>>, pub time_elapsed_query: Option<&'a TimeElapsedQuery>, pub primitives_generated_query: Option<&'a PrimitivesGeneratedQuery>, pub transform_feedback_primitives_written_query: Option<&'a TransformFeedbackPrimitivesWrittenQuery>, pub condition: Option<ConditionalRendering<'a>>, pub transform_feedback: Option<&'a TransformFeedbackSession<'a>>, pub smooth: Option<Smooth>, pub provoking_vertex: ProvokingVertex, pub primitive_bounding_box: (Range<f32>, Range<f32>, Range<f32>, Range<f32>), }
Represents the parameters to use when drawing.
Example:
let params = glium::DrawParameters { depth: glium::Depth { test: glium::DepthTest::IfLess, write: true, .. Default::default() }, .. Default::default() };
Fields
depth | How the fragment will interact with the depth buffer. |
stencil | How the fragment will interact with the stencil buffer. |
blend | The effect that the GPU will use to merge the existing pixel with the pixel that is being written. |
color_mask | Allows you to disable some color components. This affects all attachments to the framebuffer. It's at the same level as the blending function. The parameters are in order: red, green, blue, alpha. |
line_width | Width in pixels of the lines to draw when drawing lines.
|
point_size | Diameter in pixels of the points to draw when drawing points.
|
backface_culling | Whether or not the GPU should filter out some faces. After the vertex shader stage, the GPU will try to remove the faces that aren't facing the camera. See the |
polygon_mode | How to render polygons. The default value is See the documentation of |
multisampling | Whether multisample antialiasing (MSAA) should be used. Default value is Note that you will need to set the appropriate option when creating the window.
The recommended way to do is to leave this to |
dithering | Whether dithering is activated. Default value is Dithering will smoothen the transition between colors in your color buffer. |
viewport | The viewport to use when drawing. The X and Y positions of your vertices are mapped to the viewport so that You can specify a viewport greater than the target if you want to stretch the image.
|
scissor | If specified, only pixels in this rect will be displayed. Default is This is different from a viewport. The image will stretch to fill the viewport, but not the scissor box. |
draw_primitives | If If If This parameter may seem pointless, but it can be useful when you use transform feedback or if you just use your shaders to write to a buffer. |
samples_passed_query | If set, each sample (ie. usually each pixel) written to the output adds one to the
counter of the |
time_elapsed_query | If set, the time it took for the GPU to execute this draw command is added to the total
stored inside the |
primitives_generated_query | If set, the number of primitives generated is added to the total stored inside the query. |
transform_feedback_primitives_written_query | If set, the number of vertices written by transform feedback. |
condition | If set, the commands will only be executed if the specified query contains |
transform_feedback | If set, then the generated primitives will be written back to a buffer. |
smooth | If set, then the generated primitives will be smoothed. Note that blending needs to be enabled for this to work. |
provoking_vertex | In your vertex shader or geometry shader, you have the possibility to mark some output
varyings as The default value is |
primitive_bounding_box | Hint for the GPU of the bounding box of the geometry. If you're using geometry shaders or tessellation shaders, it can be extremely advantageous
for the GPU to know where on the screen the primitive is. This field specifies the
bounding box ( The GPU is free not to draw samples outside of the bounding box. Whether the samples are drawn is implementation-specific. This field is useless if you're not using a geometry shader or tessellation shader. Since this is purely an optimization, this parameter is ignored if the backend doesn't support it. |