Implementing a Debug Renderer #902
Replies: 1 comment 2 replies
-
Yes DrawTriangle expects you to draw a non-wire frame triangle, so you cannot achieve the same thing with DrawLine (although you're free to implement it that way). The reason that CreateTriangleBatch exists is so that you can create a vertex/index buffer for a large batch of triangles. It is possible to internally route this through DrawTriangle, but for complex Shapes this is so inefficient that the frame rate suffers. Most shapes call CreateTriangleBatch multiple times to create different LOD versions of the same shape (this happens only the first time when rendering a shape) and when rendering the shape it calls DrawGeometry with the created batches. Your implementation is then expected to select the right LOD and render it. If you don't know how/don't want to calculate the right LOD, just draw the highest LOD. |
Beta Was this translation helpful? Give feedback.
-
Hi I'm working with jolt to create my game, I need to get a jolt debug renderer going so I can actually see what jolt sees.
I'm using opengl3 and I have been looking at https://jrouwe.github.io/JoltPhysics/class_debug_renderer.html. From what I understand I need to subclass this class and then implement every function that is labelled virtual, is that right?
The virtual methods there are:
I'm familiar with how I might implement
DrawLine
andDrawTriangle
, but why do we have have to implement both? Does this imply that there is a way to toggle a wireframe mode and a triangle mode with the debug renderer?I'm hoping that someone can explain if I have to implement all of the virtual methods or if I can just get away with implementing
DrawLine
, also what the purpose of the Batch functions are. Thanks a lotBeta Was this translation helpful? Give feedback.
All reactions