Graphics class that represents the technique used in forward rendering.
More...
|
static bool | Initialize () |
| Initializes the forward render technique. More...
|
|
static void | Uninitialize () |
| Uninitializes the forward render technique.
|
|
|
void | ChooseLights (const Spheref &object, bool includeDirectionalLights=true) const |
| Chooses the nearest lights for one object. More...
|
|
void | DrawBasicSprites (const SceneData &sceneData, ForwardRenderQueue::Layer &layer) const |
| Draws basic sprites. More...
|
|
void | DrawBillboards (const SceneData &sceneData, ForwardRenderQueue::Layer &layer) const |
| Draws billboards. More...
|
|
void | DrawOpaqueModels (const SceneData &sceneData, ForwardRenderQueue::Layer &layer) const |
| Draws opaques models. More...
|
|
void | DrawOrderedSprites (const SceneData &sceneData, ForwardRenderQueue::Layer &layer) const |
|
void | DrawTransparentModels (const SceneData &sceneData, ForwardRenderQueue::Layer &layer) const |
| Draws transparent models. More...
|
|
const ShaderUniforms * | GetShaderUniforms (const Shader *shader) const |
| Gets the shader uniforms. More...
|
|
void | OnShaderInvalidated (const Shader *shader) const |
| Handle the invalidation of a shader. More...
|
|
void | SendLightUniforms (const Shader *shader, const LightUniforms &uniforms, unsigned int index, unsigned int lightIndex, unsigned int uniformOffset) const |
| Sends the uniforms for light. More...
|
|
|
std::unordered_map< const Shader *, ShaderUniforms > | m_shaderUniforms |
|
std::vector< LightIndex > | m_lights |
|
Buffer | m_vertexBuffer |
|
ForwardRenderQueue | m_renderQueue |
|
Texture | m_whiteTexture |
|
VertexBuffer | m_billboardPointBuffer |
|
VertexBuffer | m_spriteBuffer |
|
unsigned int | m_maxLightPassPerObject |
|
bool | m_instancingEnabled |
|
|
static IndexBuffer | s_quadIndexBuffer |
|
static Texture | s_dummyReflection |
|
static TextureSampler | s_reflectionSampler |
|
static TextureSampler | s_shadowSampler |
|
static VertexBuffer | s_quadVertexBuffer |
|
static VertexDeclaration | s_billboardInstanceDeclaration |
|
static VertexDeclaration | s_billboardVertexDeclaration |
|
Graphics class that represents the technique used in forward rendering.
◆ ChooseLights()
void Nz::ForwardRenderTechnique::ChooseLights |
( |
const Spheref & |
object, |
|
|
bool |
includeDirectionalLights = true |
|
) |
| const |
|
protected |
Chooses the nearest lights for one object.
- Parameters
-
object | Sphere symbolising the object |
includeDirectionalLights | Should directional lights be included in the computation |
◆ Clear()
void Nz::ForwardRenderTechnique::Clear |
( |
const SceneData & |
sceneData | ) |
const |
|
overridevirtual |
◆ ComputeDirectionalLightScore()
float Nz::ForwardRenderTechnique::ComputeDirectionalLightScore |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::DirectionalLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Computes the score for directional light.
- Returns
- 0.f
- Parameters
-
object | Sphere symbolising the object |
light | Light to compute |
TODO: Compute a score depending on the light luminosity
◆ ComputePointLightScore()
float Nz::ForwardRenderTechnique::ComputePointLightScore |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::PointLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Computes the score for point light.
- Returns
- Distance to the light
- Parameters
-
object | Sphere symbolising the object |
light | Light to compute |
TODO: Compute a score depending on the light luminosity
◆ ComputeSpotLightScore()
float Nz::ForwardRenderTechnique::ComputeSpotLightScore |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::SpotLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Computes the score for spot light.
- Returns
- Distance to the light
- Parameters
-
object | Sphere symbolising the object |
light | Light to compute |
TODO: Compute a score depending on the light luminosity and spot direction
◆ Draw()
bool Nz::ForwardRenderTechnique::Draw |
( |
const SceneData & |
sceneData | ) |
const |
|
overridevirtual |
◆ DrawBasicSprites()
void Nz::ForwardRenderTechnique::DrawBasicSprites |
( |
const SceneData & |
sceneData, |
|
|
ForwardRenderQueue::Layer & |
layer |
|
) |
| const |
|
protected |
Draws basic sprites.
- Parameters
-
sceneData | Data of the scene |
layer | Layer of the rendering |
◆ DrawBillboards()
void Nz::ForwardRenderTechnique::DrawBillboards |
( |
const SceneData & |
sceneData, |
|
|
ForwardRenderQueue::Layer & |
layer |
|
) |
| const |
|
protected |
Draws billboards.
- Parameters
-
sceneData | Data of the scene |
layer | Layer of the rendering |
◆ DrawOpaqueModels()
void Nz::ForwardRenderTechnique::DrawOpaqueModels |
( |
const SceneData & |
sceneData, |
|
|
ForwardRenderQueue::Layer & |
layer |
|
) |
| const |
|
protected |
Draws opaques models.
- Parameters
-
sceneData | Data of the scene |
layer | Layer of the rendering |
◆ DrawTransparentModels()
void Nz::ForwardRenderTechnique::DrawTransparentModels |
( |
const SceneData & |
sceneData, |
|
|
ForwardRenderQueue::Layer & |
layer |
|
) |
| const |
|
protected |
Draws transparent models.
- Parameters
-
sceneData | Data of the scene |
layer | Layer of the rendering |
◆ GetMaxLightPassPerObject()
unsigned int Nz::ForwardRenderTechnique::GetMaxLightPassPerObject |
( |
| ) |
const |
Gets the maximum number of lights available per pass per object.
- Returns
- Maximum number of light simulatenously per object
◆ GetRenderQueue()
◆ GetShaderUniforms()
const ForwardRenderTechnique::ShaderUniforms * Nz::ForwardRenderTechnique::GetShaderUniforms |
( |
const Shader * |
shader | ) |
const |
|
protected |
Gets the shader uniforms.
- Returns
- Uniforms of the shader
- Parameters
-
shader | Shader to get uniforms from |
◆ GetType()
RenderTechniqueType Nz::ForwardRenderTechnique::GetType |
( |
| ) |
const |
|
overridevirtual |
◆ Initialize()
bool Nz::ForwardRenderTechnique::Initialize |
( |
| ) |
|
|
static |
Initializes the forward render technique.
- Returns
- true If successful
◆ IsDirectionalLightSuitable()
bool Nz::ForwardRenderTechnique::IsDirectionalLightSuitable |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::DirectionalLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Checks whether the directional light is suitable for the computations.
- Returns
- true if light is enoughly close
- Parameters
-
object | Sphere symbolising the object |
light | Light to compute |
◆ IsPointLightSuitable()
bool Nz::ForwardRenderTechnique::IsPointLightSuitable |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::PointLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Checks whether the point light is suitable for the computations.
- Returns
- true if light is close enough
- Parameters
-
object | Sphere symbolizing the object |
light | Light to compute |
◆ IsSpotLightSuitable()
bool Nz::ForwardRenderTechnique::IsSpotLightSuitable |
( |
const Spheref & |
object, |
|
|
const AbstractRenderQueue::SpotLight & |
light |
|
) |
| |
|
inlinestaticprotected |
Checks whether the spot light is suitable for the computations.
- Returns
- true if light is close enough
- Parameters
-
object | Sphere symbolizing the object |
light | Light to compute |
TODO: Exclude spot lights based on their direction and outer angle?
◆ OnShaderInvalidated()
void Nz::ForwardRenderTechnique::OnShaderInvalidated |
( |
const Shader * |
shader | ) |
const |
|
protected |
Handle the invalidation of a shader.
- Parameters
-
shader | Shader being invalidated |
◆ SendLightUniforms()
void Nz::ForwardRenderTechnique::SendLightUniforms |
( |
const Shader * |
shader, |
|
|
const LightUniforms & |
uniforms, |
|
|
unsigned int |
index, |
|
|
unsigned int |
lightIndex, |
|
|
unsigned int |
uniformOffset |
|
) |
| const |
|
protected |
Sends the uniforms for light.
- Parameters
-
shader | Shader to send uniforms to |
uniforms | Uniforms to send |
index | Index of the light |
uniformOffset | Offset for the uniform |
availableTextureUnit | Unit texture available |
◆ SetMaxLightPassPerObject()
void Nz::ForwardRenderTechnique::SetMaxLightPassPerObject |
( |
unsigned int |
maxLightPassPerObject | ) |
|
Sets the maximum number of lights available per pass per object.
- Parameters
-
passCount | Maximum number of light simulatenously per object |
The documentation for this class was generated from the following files:
- include/Nazara/Graphics/ForwardRenderTechnique.hpp
- include/Nazara/Graphics/ForwardRenderTechnique.inl
- src/Nazara/Graphics/ForwardRenderTechnique.cpp