![]() |
OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Implementation of Clustered Forward Shading. More...
#include <OgreForwardClustered.h>
Public Types | |
typedef vector< CachedGridBuffer >::type | CachedGridBufferVec |
enum | ForwardPlusMethods { MethodForward3D , MethodForwardClustered , NumForwardPlusMethods } |
Public Member Functions | |
ForwardClustered (uint32 width, uint32 height, uint32 numSlices, uint32 lightsPerCell, uint32 decalsPerCell, uint32 cubemapProbesPerCell, float minDistance, float maxDistance, SceneManager *sceneManager) | |
virtual | ~ForwardClustered () |
void | _changeRenderSystem (RenderSystem *newRs) |
void | _releaseManualHardwareResources () |
void | collectLights (Camera *camera) override |
void | execute (size_t threadId, size_t numThreads) override |
Overload this function to perform whatever you want. More... | |
void | fillConstBufferData (Viewport *viewport, bool bRequiresTextureFlipping, uint32 renderTargetHeight, IdString shaderSyntax, bool instancedStereo, float *RESTRICT_ALIAS passBufferPtr) const override |
Fills 'passBufferPtr' with the necessary data for ForwardClustered rendering. More... | |
size_t | getConstBufferSize () const override |
Returns the amount of bytes that fillConstBufferData is going to fill. More... | |
bool | getDebugFrustum () const |
bool | getDebugMode () const |
bool | getDecalsEnabled () const |
uint32 | getDecalsPerCell () const |
bool | getEnableVpls () const |
bool | getFadeAttenuationRange () const |
bool | getFineLightMaskGranularity () const |
ForwardPlusMethods | getForwardPlusMethod () const override |
bool | getFreezeDebugFrustum () const |
ReadOnlyBufferPacked * | getGlobalLightListBuffer (const Camera *camera) const |
Cache the return value as internally we perform an O(N) search. More... | |
TexBufferPacked * | getGridBuffer (const Camera *camera) const |
Cache the return value as internally we perform an O(N) search. More... | |
uint32 | getHeight () const |
uint32 | getLightsPerCell () const |
float | getMaxDistance () const |
float | getMinDistance () const |
uint32 | getNumSlices () const |
uint32 | getWidth () const |
bool | isCacheDirty (const Camera *camera) const |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void | setDebugFrustum (bool bEnableDebugFrustumWireAabb) |
void | setDebugMode (bool debugMode) |
Turns on visualization of light cell occupancy. More... | |
void | setEnableVpls (bool enable) |
void | setFadeAttenuationRange (bool fade) |
Attenuates the light by the attenuation range, causing smooth endings when at the end of the light range instead of a sudden sharp termination. More... | |
void | setFineLightMaskGranularity (bool useFineGranularity) |
Toggles whether light masks will be obeyed per object & per light by doing: if( movableObject->getLightMask() & light->getLightMask() ) doLighting( movableObject light ); Note this toggle only affects Forward+ lights. More... | |
void | setFreezeDebugFrustum (bool freezeDebugFrustum) |
void | setHlmsPassProperties (Hlms *hlms) override |
Static Public Attributes | |
static const size_t | MaxCubemapProbeRq |
static const size_t | MaxDecalRq |
static const size_t | MinCubemapProbeRq |
static const size_t | MinDecalRq |
Implementation of Clustered Forward Shading.
|
inherited |
|
inherited |
Ogre::ForwardClustered::ForwardClustered | ( | uint32 | width, |
uint32 | height, | ||
uint32 | numSlices, | ||
uint32 | lightsPerCell, | ||
uint32 | decalsPerCell, | ||
uint32 | cubemapProbesPerCell, | ||
float | minDistance, | ||
float | maxDistance, | ||
SceneManager * | sceneManager | ||
) |
|
virtual |
|
inherited |
|
inherited |
|
overridevirtual |
Implements Ogre::ForwardPlusBase.
|
overridevirtual |
Overload this function to perform whatever you want.
It will be called from all worker threads at the same time.
threadId | The index of the thread it is being called from. An index is guaranteed to be in range [0; numThreads) |
numThreads | Number of total threads |
Implements Ogre::UniformScalableTask.
|
overridevirtual |
Fills 'passBufferPtr' with the necessary data for ForwardClustered rendering.
Implements Ogre::ForwardPlusBase.
|
overridevirtual |
Returns the amount of bytes that fillConstBufferData is going to fill.
Implements Ogre::ForwardPlusBase.
bool Ogre::ForwardClustered::getDebugFrustum | ( | ) | const |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineoverridevirtual |
Implements Ogre::ForwardPlusBase.
bool Ogre::ForwardClustered::getFreezeDebugFrustum | ( | ) | const |
|
inherited |
Cache the return value as internally we perform an O(N) search.
|
inherited |
Cache the return value as internally we perform an O(N) search.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
void Ogre::ForwardClustered::setDebugFrustum | ( | bool | bEnableDebugFrustumWireAabb | ) |
|
inlineinherited |
Turns on visualization of light cell occupancy.
|
inlineinherited |
|
inlineinherited |
Attenuates the light by the attenuation range, causing smooth endings when at the end of the light range instead of a sudden sharp termination.
This isn't physically based (light's range is infinite), but looks very well, and makes more intuitive to manipulate a light by controlling its range instead of controlling its radius.
In math: atten *= max( (attenRange - fDistance) / attenRange, 0.0f );
|
inlineinherited |
Toggles whether light masks will be obeyed per object & per light by doing: if( movableObject->getLightMask() & light->getLightMask() ) doLighting( movableObject light ); Note this toggle only affects Forward+ lights.
You may want to see HlmsPbs::setFineLightMaskGranularity for control over Forward lights. If you only need coarse granularity control over Forward+ lights, you may get higher performance via CompositorPassSceneDef::mLightVisibilityMask (light_visibility_mask keyword in scripts).
void Ogre::ForwardClustered::setFreezeDebugFrustum | ( | bool | freezeDebugFrustum | ) |
|
overridevirtual |
Reimplemented from Ogre::ForwardPlusBase.
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |