#include <spGBuffer.hpp>
List of all members.
Detailed Description
A geometry buffer (G-Buffer) contains all textures which are required for a deferred renderer. It conatins at least the diffuse- and normal map. It contains optionally an illumination map when pre-computed, static light-maps are used in combination with dynamic light sources. Specular information is stored in the alpha-channel of the diffuse map, that's because transparency can anyway not be used within a deferred renderer.
- Since:
- Version 3.2
Member Enumeration Documentation
GBuffer render target names.
- Enumerator:
RENDERTARGET_DIFFUSE_AND_SPECULAR |
Diffuse (RGB) and specular (A).
|
RENDERTARGET_NORMAL_AND_DEPTH |
Normal vectors (RGB) and depth distance (A).
|
RENDERTARGET_ILLUMINATION |
Illumination (R) from light maps.
|
RENDERTARGET_COUNT |
Internal count constant. Don't use it to access a texture!
|
Constructor & Destructor Documentation
sp::video::GBuffer::GBuffer |
( |
|
) |
|
virtual sp::video::GBuffer::~GBuffer |
( |
|
) |
[virtual] |
Member Function Documentation
void sp::video::GBuffer::bindRenderTargets |
( |
|
) |
|
Binds the g-buffer's render targets. The following pixel shader pseudo code illustrates that:
struct SPixelOutput
{
float4 DiffuseAndSpecular : COLOR0;
float4 NormalAndDepth : COLOR1;
};
Out.DiffuseAndSpecular.rgb = FinalPixelColor;
Out.DiffuseAndSpecular.a = FinalPixelSpecularFactor;
Out.NormalAndDepth.xyz = FinalPixelNormal;
Out.NormalAndDepth.a = distance(GlobalViewPosition, GlobalPixelPosition);
bool sp::video::GBuffer::createGBuffer |
( |
const dim::size2di & |
Resolution, |
|
|
s32 |
MultiSampling = 0 , |
|
|
bool |
UseIllumination = false | |
|
) |
| | |
Creates the GBuffer textures.
- Parameters:
-
[in] | Resolution | Specifies the resolution. This should be the same as specified for the engine's graphics device. |
[in] | MultiSampling | Specifies the count of multi-samples. By default 0. |
[in] | UseIllumination | Specifies whether illumination should be used or not. This is used to combine dynamic lights with pre-computed static light-maps. By default false. |
- Returns:
- True if the g-buffer could be created successful.
void sp::video::GBuffer::deleteGBuffer |
( |
|
) |
|
Deletes the GBuffer textures. When creating a new GBuffer the old textures will be deleted automatically.
void sp::video::GBuffer::drawDeferredShading |
( |
|
) |
|
const dim::size2di& sp::video::GBuffer::getResolution |
( |
|
) |
const [inline] |
Returns the resolution set after creating the GBuffer textures.
Returns the specified GBuffer texture.
- Parameters:
-
| Type,: | Specifies the texture name which is to be returned. This must not be RENDERTARGET_COUNT! |
- Returns:
- Pointer to the specified Texture object.
bool sp::video::GBuffer::useIllumination |
( |
|
) |
const [inline] |
The documentation for this class was generated from the following file:
- D:/SoftwareEntwicklung/C++/HLC/Tools/SoftPixelEngine/repository/sources/RenderSystem/DeferredRenderer/spGBuffer.hpp