RenderDraw
The RenderDraw class provides methods to draw output textures, Scene Graph BVH trees, RenderFrame geometries, and a variety of debug primitives. Debug primitives rendering can be applied to multiple independent viewports without recreating the data.
#include <render/TellusimRenderDraw.h>
Constructors
RenderDraw()
Methods
Draw parameters.
Format getColorFormat() const
Format getDepthFormat() const
uint32_t getMultisample() const
Draw texture.
void drawTexture(Command &command, Texture &texture, bool flipped, Mode mode = ModeTexture)
void drawTexture(Command &command, Texture &texture, float32_t x0, float32_t y0, float32_t x1, float32_t y1, bool flipped, Mode mode = ModeTexture)
Draw scene graph tree.
void drawGraphTree(Command &command, const RenderFrame &frame, const Graph &graph, Matrix4x3d transform, Color light, Color object, Color instance, bool flipped, float32_t bias = 0.0f)
void drawGraphTree(Command &command, const RenderFrame &frame, const Graph &graph, Color light, Color object, Color instance, bool flipped, float32_t bias = 0.0f)
void drawGraphTree(Command &command, const RenderFrame &frame, const Graph &graph, Matrix4x3d transform, bool flipped, float32_t bias = 0.0f)
void drawGraphTree(Command &command, const RenderFrame &frame, const Graph &graph, bool flipped, float32_t bias = 0.0f)
Draw render frame.
void drawRenderFrame(Command &command, const RenderFrame &frame, Color geometry, bool flipped, float32_t bias = 0.0f)
void drawRenderFrame(Command &command, const RenderFrame &frame, bool flipped, float32_t bias = 0.0f)
Clear primitives.
void clearPrimitives()
Draw primitives.
void drawPrimitives(Command &command, const RenderFrame &frame, bool flipped, float32_t bias = 0.0f, bool clear = true)
Type | Name | Description |
---|---|---|
bool | clear | Clear primitives after drawing. |
void drawLine(Transform transform, Vector3f p0, Vector3f p1, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawLine(Matrix4x3d transform, Vector3f p0, Vector3f p1, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw arrow.
void drawArrow(Transform transform, Vector3f p0, Vector3f p1, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawArrow(Matrix4x3d transform, Vector3f p0, Vector3f p1, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw quadratic spline.
void drawQuadratic(Transform transform, Vector3f p0, Vector3f p1, Vector3f p2, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawQuadratic(Matrix4x3d transform, Vector3f p0, Vector3f p1, Vector3f p2, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw cubic spline.
void drawCubic(Transform transform, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawCubic(Matrix4x3d transform, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw triangle.
void drawTriangle(Transform transform, Vector3f p0, Vector3f p1, Vector3f p2, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawTriangle(Matrix4x3d transform, Vector3f p0, Vector3f p1, Vector3f p2, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw rectangle.
void drawRect(Transform transform, Vector2f size, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawRect(Matrix4x3d transform, Vector2f size, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw quadrilateral.
void drawQuad(Transform transform, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawQuad(Matrix4x3d transform, Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw circle.
void drawCircle(Transform transform, float32_t radius, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawCircle(Matrix4x3d transform, float32_t radius, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw arc.
void drawArc(Transform transform, float32_t radius, float32_t a0, float32_t a1, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawArc(Matrix4x3d transform, float32_t radius, float32_t a0, float32_t a1, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw box.
void drawBox(Transform transform, Vector3f size, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawBox(Matrix4x3d transform, Vector3f size, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw sphere.
void drawSphere(Transform transform, float32_t radius, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawSphere(Matrix4x3d transform, float32_t radius, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw capsule.
void drawCapsule(Transform transform, float32_t radius, float32_t height, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawCapsule(Matrix4x3d transform, float32_t radius, float32_t height, Color color, Matrix4x3f local = Matrix4x3f::identity)
Draw cylider.
void drawCylinder(Transform transform, float32_t radius, float32_t height, Color color, Matrix4x3f local = Matrix4x3f::identity)
void drawCylinder(Matrix4x3d transform, float32_t radius, float32_t height, Color color, Matrix4x3f local = Matrix4x3f::identity)
Enums
Mode
Name | Value | Description |
---|---|---|
ModeTexture | 0 | Draw diffuse/normal texture. |
ModeComposite | 1 | Draw composite/color texture with dithering. |
ModeMetallic | 2 | Draw metallic texture 2x2 split. |
ModeAuxiliary | 3 | Draw auxiliary texture 2x2 split. |
ModeAddress | 4 | Draw auxiliary texture address. |
ModeMotion | 5 | Draw motion texture. |
ModeShadow | 6 | Draw shadow texture. |
ModeDepth | 7 | Draw depth texture. |
ModeRed | 8 | Draw texture red channel. |
ModeGreen | 9 | Draw texture green channel. |
ModeBlue | 10 | Draw texture blue channel. |
ModeAlpha | 11 | Draw texture alpha channel. |
NumModes | 12 |
Structs
Transform
Primitive transform.
Variables
Type | Name | Value | Description |
---|---|---|---|
uint32_t | graph_index | Maxu32 | Graph index. |
uint32_t | node_index | Maxu32 | Graph node index. |
uint32_t | object_node_index | Maxu32 | Object node index. |
uint32_t | geometry_index | Maxu32 | Geometry index. |
uint32_t | body_index | Maxu32 | Body index. |
uint32_t | shape_index | Maxu32 | Shape index. |