Skip to main content

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)
TypeNameDescription
boolclearClear 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

NameValueDescription
ModeTexture0Draw diffuse/normal texture.
ModeComposite1Draw composite/color texture with dithering.
ModeMetallic2Draw metallic texture 2x2 split.
ModeAuxiliary3Draw auxiliary texture 2x2 split.
ModeAddress4Draw auxiliary texture address.
ModeMotion5Draw motion texture.
ModeShadow6Draw shadow texture.
ModeDepth7Draw depth texture.
ModeRed8Draw texture red channel.
ModeGreen9Draw texture green channel.
ModeBlue10Draw texture blue channel.
ModeAlpha11Draw texture alpha channel.
NumModes12

Structs

Transform

Primitive transform.

Variables

TypeNameValueDescription
uint32_tgraph_indexMaxu32Graph index.
uint32_tnode_indexMaxu32Graph node index.
uint32_tobject_node_indexMaxu32Object node index.
uint32_tgeometry_indexMaxu32Geometry index.
uint32_tbody_indexMaxu32Body index.
uint32_tshape_indexMaxu32Shape index.