
The things you really have to set before rendering are: It follows various current RenderContext state, like TRenderContext.DepthTest, TRenderContext.LineWidth – it doesn't control this state.įor a full-featured mesh rendering, just use TCastleScene, and construct your mesh as TIndexedTriangleSetNode or TIndexedFaceSetNode, see. So it works even with OpenGLES 2.0 (not 3.0) or WebGL 1.0.Īlways passes vectors as 4D (in homogeneous coordinates). If it uses indexes, it always uses 16-bit indexes, not 32-bit. It doesn't define any per-vertex attributes other than vertex positions.

Some deliberate limitations / hardcoded assumptions to keep this class simple: This is not a full-featured mesh renderer. This is suitable to render only trivial unlit (or invisible) meshes. This has to be created and destroyed while the OpenGL(ES) context is active. Make sure all usage is within the same rendering context.

on OpenGL(ES) it creates 1 VBO (vertex buffer object) for position data and optional 1 VBO for indexes (if SetIndexes is ever called). This is a deliberately simple and thin wrapper over creating and drawing a bunch of vertexes on modern GPUs.

Can be used multiple times, to render the same vertexes many times. Render a set of vertexes, with optional indexes. Type TCastleRenderUnlitMesh = class(TObject) Description
