This reference page is linked to from the following overview topics: Nitrous Graphics SDK Extensions.
#include <IRenderGeometry.h>
IRenderGeometry is a presentation of geometry.
Realize() function is used to define "what is" the geometry. And Display() function defines "how" the geometry looks like. Most of the time, inherited classes prepares vertex buffers and index buffers in the Realize() function, and use VirtualDevice to render these buffer in the Display() function.
Public Member Functions |
|
virtual void | Display (DrawContext &drawContext, int start, int count, int lod)=0 |
This function might be called multiple times
in a frame. |
|
virtual PrimitiveType | GetPrimitiveType ()=0 |
Get the type of primitives in the geometry.
|
|
virtual void | SetPrimitiveType (PrimitiveType type)=0 |
Sets type of primitives in the geometry.
|
|
virtual size_t | GetPrimitiveCount ()=0 |
Number of primitives the mesh represents.
|
|
virtual size_t | GetVertexCount ()=0 |
Number of vertices in the mesh. |
|
virtual MaterialRequiredStreams & | GetSteamRequirement ()=0 |
Get the stream requirement of this render
geometry. |
|
virtual VertexBufferHandleArray & | GetVertexBuffers ()=0 |
Get the vertex streams of this geometry.
|
|
virtual IndexBufferHandle & | GetIndexBuffer ()=0 |
Get index buffer of this geometry. |
virtual void Display | ( | DrawContext & | drawContext, |
int | start, | ||
int | count, | ||
int | lod | ||
) | [pure virtual] |
This function might be called multiple times in a frame.
Inherited classes need to use in the pipeline context ti render the geometry. It's recommend to prepare geometry data in the Realize() function, and only do rendering tasks in Display() function. Furthermore, sub-classes are not allowed to change current material parameters. So for multiple material instance, you should use multiple render items to store them. Note: the vertex buffers' format must match current stream requirement in pipeline context. /param drawContext the context for display /param start start primitive to render /param count primitive count to render /param lod current lod value from AD system
virtual PrimitiveType GetPrimitiveType | ( | ) | [pure virtual] |
Get the type of primitives in the geometry.
/return the geometry's primitive type
virtual void SetPrimitiveType | ( | PrimitiveType | type | ) | [pure virtual] |
Sets type of primitives in the geometry.
/param type the geometry's primitive type
virtual size_t GetPrimitiveCount | ( | ) | [pure virtual] |
Number of primitives the mesh represents.
/return geometry's primitive count
virtual size_t GetVertexCount | ( | ) | [pure virtual] |
virtual MaterialRequiredStreams& GetSteamRequirement | ( | ) | [pure virtual] |
Get the stream requirement of this render geometry.
To optimize performance, it's better to create a requirement-geometry mapping. And make the render geometry read-only after created.
virtual VertexBufferHandleArray& GetVertexBuffers | ( | ) | [pure virtual] |
Get the vertex streams of this geometry.
virtual IndexBufferHandle& GetIndexBuffer | ( | ) | [pure virtual] |
Get index buffer of this geometry.