![]() |
Lysa
0.0
Lysa 3D Engine
|
Immediate-style 2D/3D vector renderer used for debug and UI primitives.
Notes:
Inheritance diagram for VectorRenderer:Classes | |
| struct | Vertex |
Public Member Functions | |
| VectorRenderer (bool depthTestEnable, bool enableAlphaBlending, bool useTextures, const RenderingConfiguration &renderingConfiguration, const std::string &name="VectorRenderer", const std::string &shadersName="vector", const std::string &glyphShadersName="glyph", bool filledTriangles=false, bool useCamera=true) | |
| void | drawLine (const float3 &from, const float3 &to, const float4 &color) |
| void | drawTriangle (const float3 &v1, const float3 &v2, const float3 &v3, const float4 &color) |
| void | drawText (const std::string &text, Font &font, float fontScale, const float3 &position, const quaternion &rotation, const float4 &innerColor) |
| void | restart () |
| void | update (const vireo::CommandList &commandList, uint32 frameIndex) |
| void | render (vireo::CommandList &commandList, const Scene &scene, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, uint32 frameIndex) |
| void | render (vireo::CommandList &commandList, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, uint32 frameIndex) |
| virtual | ~VectorRenderer () = default |
| VectorRenderer (VectorRenderer &) = delete | |
| VectorRenderer & | operator= (VectorRenderer &) = delete |
Protected Member Functions | |
| int32 | addTexture (const std::shared_ptr< Image > &texture) |
| int32 | addFont (const Font &font) |
Protected Attributes | |
| const RenderingConfiguration & | config |
| bool | vertexBufferDirty {true} |
| std::vector< Vertex > | linesVertices |
| std::vector< Vertex > | triangleVertices |
| std::vector< Vertex > | glyphVertices |
| VectorRenderer | ( | bool | depthTestEnable, |
| bool | enableAlphaBlending, | ||
| bool | useTextures, | ||
| const RenderingConfiguration & | renderingConfiguration, | ||
| const std::string & | name = "VectorRenderer", |
||
| const std::string & | shadersName = "vector", |
||
| const std::string & | glyphShadersName = "glyph", |
||
| bool | filledTriangles = false, |
||
| bool | useCamera = true |
||
| ) |
Constructs a vector renderer.
| depthTestEnable | Enable depth test for 3D primitives. |
| enableAlphaBlending | Enable alpha blending (for UI/text). |
| useTextures | Allow textured triangles. |
| renderingConfiguration | Global rendering config. |
| name | Debug name for pipelines. |
| shadersName | Base shader name for vector primitives. |
| glyphShadersName | Base shader name for glyph rendering. |
| filledTriangles | True to use triangle pipeline; false for wireframe only. |
| useCamera | True to apply Scene view/projection. |
|
virtualdefault |
|
delete |
| void drawLine | ( | const float3 & | from, |
| const float3 & | to, | ||
| const float4 & | color | ||
| ) |
Adds a colored line segment to the current batch.
| void drawText | ( | const std::string & | text, |
| Font & | font, | ||
| float | fontScale, | ||
| const float3 & | position, | ||
| const quaternion & | rotation, | ||
| const float4 & | innerColor | ||
| ) |
Adds text to the current batch using the provided font.
| text | UTF-8 string to render. |
| font | Font object providing glyph atlas/metrics. |
| fontScale | Scaling factor applied to glyph metrics. |
| position | Baseline origin for the text in world/screen space. |
| rotation | Orientation for the text in world space. |
| innerColor | Color applied to glyphs (vertex alpha can modulate it). |
| void drawTriangle | ( | const float3 & | v1, |
| const float3 & | v2, | ||
| const float3 & | v3, | ||
| const float4 & | color | ||
| ) |
Adds a filled triangle to the current batch.
|
delete |
| void render | ( | vireo::CommandList & | commandList, |
| const Scene & | scene, | ||
| const std::shared_ptr< vireo::RenderTarget > & | colorAttachment, | ||
| const std::shared_ptr< vireo::RenderTarget > & | depthAttachment, | ||
| uint32 | frameIndex | ||
| ) |
Renders accumulated primitives using the given Scene (with camera).
| commandList | Command buffer to record into. |
| scene | Scene providing camera matrices. |
| colorAttachment | Target color surface. |
| depthAttachment | Target depth surface (may be null if no depth). |
| frameIndex | Index of the current frame in flight. |
| void render | ( | vireo::CommandList & | commandList, |
| const std::shared_ptr< vireo::RenderTarget > & | colorAttachment, | ||
| const std::shared_ptr< vireo::RenderTarget > & | depthAttachment, | ||
| uint32 | frameIndex | ||
| ) |
Renders accumulated primitives without referencing a Scene camera. Useful for UI-like overlays in screen space.
| void restart | ( | ) |
Clears accumulated geometry (call once per frame).
| void update | ( | const vireo::CommandList & | commandList, |
| uint32 | frameIndex | ||
| ) |
Uploads dirty vertex buffers and prepares descriptor sets.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |