Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::ForwardRenderQueue Class Reference

Graphics class that represents the rendering queue for forward rendering. More...

Inheritance diagram for Nz::ForwardRenderQueue:
Nz::AbstractRenderQueue Nz::DepthRenderQueue

Classes

struct  BillboardData
 Billboards. More...
 
struct  MeshDataComparator
 Meshes. More...
 
struct  SpriteChain_XYZ_Color_UV
 Sprites. More...
 

Public Types

using BatchedBillboardContainer = std::map< const Material *, BatchedBillboardEntry, MaterialComparator >
 
using BillboardPipelineBatches = std::map< const MaterialPipeline *, BatchedBillboardPipelineEntry, MaterialPipelineComparator >
 
using SpriteOverlayBatches = std::map< const Texture *, BatchedSpriteEntry >
 
using SpriteMaterialBatches = std::map< const Material *, BatchedBasicSpriteEntry, MaterialComparator >
 
using SpritePipelineBatches = std::map< const MaterialPipeline *, BatchedSpritePipelineEntry, MaterialPipelineComparator >
 
using MeshInstanceContainer = std::map< MeshData, MeshInstanceEntry, MeshDataComparator >
 
using MeshMaterialBatches = std::map< const Material *, BatchedModelEntry, MaterialComparator >
 
using MeshPipelineBatches = std::map< const MaterialPipeline *, BatchedMaterialEntry, MaterialPipelineComparator >
 

Public Member Functions

void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const Vector2f > sizePtr, SparsePtr< const Vector2f > sinCosPtr=nullptr, SparsePtr< const Color > colorPtr=nullptr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const Vector2f > sizePtr, SparsePtr< const Vector2f > sinCosPtr, SparsePtr< const float > alphaPtr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const Vector2f > sizePtr, SparsePtr< const float > anglePtr, SparsePtr< const Color > colorPtr=nullptr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const Vector2f > sizePtr, SparsePtr< const float > anglePtr, SparsePtr< const float > alphaPtr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const float > sizePtr, SparsePtr< const Vector2f > sinCosPtr=nullptr, SparsePtr< const Color > colorPtr=nullptr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const float > sizePtr, SparsePtr< const Vector2f > sinCosPtr, SparsePtr< const float > alphaPtr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const float > sizePtr, SparsePtr< const float > anglePtr, SparsePtr< const Color > colorPtr=nullptr) override
 Adds multiple billboards to the queue. More...
 
void AddBillboards (int renderOrder, const Material *material, unsigned int count, SparsePtr< const Vector3f > positionPtr, SparsePtr< const float > sizePtr, SparsePtr< const float > anglePtr, SparsePtr< const float > alphaPtr) override
 Adds multiple billboards to the queue. More...
 
void AddDrawable (int renderOrder, const Drawable *drawable) override
 Adds drawable to the queue. More...
 
void AddMesh (int renderOrder, const Material *material, const MeshData &meshData, const Boxf &meshAABB, const Matrix4f &transformMatrix) override
 Adds mesh to the queue. More...
 
void AddSprites (int renderOrder, const Material *material, const VertexStruct_XYZ_Color_UV *vertices, std::size_t spriteCount, const Texture *overlay=nullptr) override
 Adds sprites to the queue. More...
 
void Clear (bool fully=false) override
 Clears the queue. More...
 
void Sort (const AbstractViewer *viewer)
 Sorts the object according to the viewer position, furthest to nearest. More...
 
- Public Member Functions inherited from Nz::AbstractRenderQueue
 AbstractRenderQueue (const AbstractRenderQueue &)=delete
 
 AbstractRenderQueue (AbstractRenderQueue &&)=default
 
virtual void AddDirectionalLight (const DirectionalLight &light)
 Adds a directional light to the rendering queue. More...
 
virtual void AddPointLight (const PointLight &light)
 Adds a point light to the rendering queue. More...
 
virtual void AddSpotLight (const SpotLight &light)
 Adds a spot light to the rendering queue. More...
 
AbstractRenderQueueoperator= (const AbstractRenderQueue &)=delete
 
AbstractRenderQueueoperator= (AbstractRenderQueue &&)=default
 

Public Attributes

std::map< int, Layer > layers
 
- Public Attributes inherited from Nz::AbstractRenderQueue
std::vector< DirectionalLight > directionalLights
 
std::vector< PointLight > pointLights
 
std::vector< SpotLight > spotLights
 

Friends

class ForwardRenderTechnique
 

Detailed Description

Graphics class that represents the rendering queue for forward rendering.

Member Function Documentation

◆ AddBillboards() [1/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const Vector2f sizePtr,
SparsePtr< const Vector2f sinCosPtr = nullptr,
SparsePtr< const Color colorPtr = nullptr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSizes of the billboards
sinCosPtrRotation of the billboards if null, Vector2f(0.f, 1.f) is used
colorPtrColor of the billboards if null, Color::White is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [2/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const Vector2f sizePtr,
SparsePtr< const Vector2f sinCosPtr,
SparsePtr< const float >  alphaPtr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSizes of the billboards
sinCosPtrRotation of the billboards if null, Vector2f(0.f, 1.f) is used
alphaPtrAlpha parameters of the billboards if null, 1.f is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [3/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const Vector2f sizePtr,
SparsePtr< const float >  anglePtr,
SparsePtr< const Color colorPtr = nullptr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSizes of the billboards
anglePtrRotation of the billboards if null, 0.f is used
colorPtrColor of the billboards if null, Color::White is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [4/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const Vector2f sizePtr,
SparsePtr< const float >  anglePtr,
SparsePtr< const float >  alphaPtr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSizes of the billboards
anglePtrRotation of the billboards if null, 0.f is used
alphaPtrAlpha parameters of the billboards if null, 1.f is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [5/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const float >  sizePtr,
SparsePtr< const Vector2f sinCosPtr = nullptr,
SparsePtr< const Color colorPtr = nullptr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSize of the billboards
sinCosPtrRotation of the billboards if null, Vector2f(0.f, 1.f) is used
colorPtrColor of the billboards if null, Color::White is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [6/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const float >  sizePtr,
SparsePtr< const Vector2f sinCosPtr,
SparsePtr< const float >  alphaPtr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSize of the billboards
sinCosPtrRotation of the billboards if null, Vector2f(0.f, 1.f) is used
alphaPtrAlpha parameters of the billboards if null, 1.f is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [7/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const float >  sizePtr,
SparsePtr< const float >  anglePtr,
SparsePtr< const Color colorPtr = nullptr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSize of the billboards
anglePtrRotation of the billboards if null, 0.f is used
colorPtrColor of the billboards if null, Color::White is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddBillboards() [8/8]

void Nz::ForwardRenderQueue::AddBillboards ( int  renderOrder,
const Material material,
unsigned int  count,
SparsePtr< const Vector3f positionPtr,
SparsePtr< const float >  sizePtr,
SparsePtr< const float >  anglePtr,
SparsePtr< const float >  alphaPtr 
)
overridevirtual

Adds multiple billboards to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the billboards
countNumber of billboards
positionPtrPosition of the billboards
sizePtrSize of the billboards
anglePtrRotation of the billboards if null, 0.f is used
alphaPtrAlpha parameters of the billboards if null, 1.f is used
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddDrawable()

void Nz::ForwardRenderQueue::AddDrawable ( int  renderOrder,
const Drawable drawable 
)
overridevirtual

Adds drawable to the queue.

Parameters
renderOrderOrder of rendering
drawableDrawable user defined
Remarks
Produces a NazaraError if drawable is invalid

Implements Nz::AbstractRenderQueue.

◆ AddMesh()

void Nz::ForwardRenderQueue::AddMesh ( int  renderOrder,
const Material material,
const MeshData &  meshData,
const Boxf meshAABB,
const Matrix4f transformMatrix 
)
overridevirtual

Adds mesh to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the mesh
meshDataData of the mesh
meshAABBBox of the mesh
transformMatrixMatrix of the mesh
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ AddSprites()

void Nz::ForwardRenderQueue::AddSprites ( int  renderOrder,
const Material material,
const VertexStruct_XYZ_Color_UV *  vertices,
std::size_t  spriteCount,
const Texture *  overlay = nullptr 
)
overridevirtual

Adds sprites to the queue.

Parameters
renderOrderOrder of rendering
materialMaterial of the sprites
verticesBuffer of data for the sprites
spriteCountNumber of sprites
overlayTexture of the sprites
Remarks
Produces a NazaraAssert if material is invalid

Implements Nz::AbstractRenderQueue.

◆ Clear()

void Nz::ForwardRenderQueue::Clear ( bool  fully = false)
overridevirtual

Clears the queue.

Parameters
fullyShould everything be cleared or we can keep layers

Reimplemented from Nz::AbstractRenderQueue.

◆ Sort()

void Nz::ForwardRenderQueue::Sort ( const AbstractViewer viewer)

Sorts the object according to the viewer position, furthest to nearest.

Parameters
viewerViewer of the scene

The documentation for this class was generated from the following files: