OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Physically based shading implementation specfically designed for OpenGL 3+, D3D11 and other RenderSystems which support uniform buffers. More...
#include <OgreHlmsPbs.h>
Public Types | |
enum | AmbientLightMode { AmbientAuto , AmbientFixed , AmbientHemisphere , AmbientSh , AmbientShMonochrome , AmbientNone } |
enum | DirtyFlags { DirtyNone = 0u , DirtyConstBuffer = 1u << 0u , DirtyTextures = 1u << 1u , DirtySamplers = 1u << 2u } |
typedef std::map< IdString, DatablockEntry > | HlmsDatablockMap |
typedef vector< Library >::type | LibraryVec |
enum | LightGatheringMode { LightGatherForward , LightGatherForwardPlus , LightGatherDeferred , LightGatherNone } |
enum | OptimizationStrategy { LowerCpuOverhead , LowerGpuOverhead } |
enum | ShadowFilter { PCF_2x2 , PCF_3x3 , PCF_4x4 , PCF_5x5 , PCF_6x6 , ExponentialShadowMaps , NumShadowFilter } |
Public Member Functions | |
HlmsPbs (Archive *dataFolder, ArchiveVec *libraryFolders) | |
virtual | ~HlmsPbs () |
virtual void | _changeRenderSystem (RenderSystem *newRs) |
void | _clearShaderCache () |
virtual void | _collectSamplerblocks (set< const HlmsSamplerblock * >::type &outSamplerblocks, const HlmsDatablock *datablock) const |
void | _compileShaderFromPreprocessedSource (const RenderableCache &mergedCache, const String source[NumShaderTypes]) |
int32 | _getProperty (IdString key, int32 defaultVal=0) const |
virtual void | _loadJson (const rapidjson::Value &jsonValue, const HlmsJson::NamedBlocks &blocks, HlmsDatablock *datablock, const String &resourceGroup, HlmsJsonListener *listener, const String &additionalTextureExtension) const |
Loads datablock values from a JSON value. More... | |
void | _notifyIblSpecMipmap (uint8 numMipmaps) |
void | _notifyManager (HlmsManager *manager) |
virtual void | _saveJson (const HlmsDatablock *datablock, String &outString, HlmsJsonListener *listener, const String &additionalTextureExtension) const |
void | _setProperty (IdString key, int32 value) |
For debugging stuff. I.e. the Command line uses it for testing manually set properties. More... | |
void | _setTextureReg (ShaderType shaderType, const char *texName, int32 texUnit) |
virtual void | analyzeBarriers (BarrierSolver &barrierSolver, ResourceTransitionArray &resourceTransitions, Camera *renderingCamera, const bool bCasterPass) |
void | compileShaderCode (ShaderCodeCache &codeCache) |
Compiles input properties and adds it to the shader code cache. More... | |
HlmsDatablock * | createDatablock (IdString name, const String &refName, const HlmsMacroblock ¯oblockRef, const HlmsBlendblock &blendblockRef, const HlmsParamVec ¶mVec, bool visibleToManager=true, const String &filename=BLANKSTRING, const String &resourceGroup=BLANKSTRING) |
Creates a unique datablock that can be shared by multiple renderables. More... | |
void | destroyAllDatablocks () |
Destroys all datablocks created with @createDatablock. More... | |
void | destroyDatablock (IdString name) |
Destroys a datablocks given its name. More... | |
virtual uint32 | fillBuffersFor (const HlmsCache *cache, const QueuedRenderable &queuedRenderable, bool casterPass, uint32 lastCacheHash, uint32 lastTextureHash) |
Fills the constant buffers. More... | |
virtual uint32 | fillBuffersForV1 (const HlmsCache *cache, const QueuedRenderable &queuedRenderable, bool casterPass, uint32 lastCacheHash, CommandBuffer *commandBuffer) |
virtual uint32 | fillBuffersForV2 (const HlmsCache *cache, const QueuedRenderable &queuedRenderable, bool casterPass, uint32 lastCacheHash, CommandBuffer *commandBuffer) |
virtual void | frameEnded () |
Called when the frame has fully ended (ALL passes have been executed to all RTTs) More... | |
AmbientLightMode | getAmbientLightMode () const |
TextureGpu * | getAreaLightMasks () const |
uint16 | getAreaLightsApproxLimit () const |
uint16 | getAreaLightsLtcLimit () const |
HlmsDatablock * | getDatablock (IdString name) const |
Finds an existing datablock based on its name (. More... | |
const HlmsDatablockMap & | getDatablockMap () const |
Returns all datablocks owned by this Hlms, including the default one. More... | |
Archive * | getDataFolder () |
bool | getDebugPssmSplits () const |
HlmsDatablock * | getDefaultDatablock () const |
Datablock to use when another datablock failed or none was specified. More... | |
uint16 | getEsmK () const |
void | getFilenameAndResourceGroup (IdString name, String const **outFilename, String const **outResourceGroup) const |
Returns the filaname & resource group a datablock was created from, and is associated with its hashed name (this was passed as in @createDatablock). More... | |
bool | getFineLightMaskGranularity () const |
bool | getHighQuality () const |
HlmsManager * | getHlmsManager () const |
IrradianceField * | getIrradianceField () |
IrradianceVolume * | getIrradianceVolume () const |
TextureGpu * | getLightProfilesTexture () const |
HlmsListener * | getListener () const |
Returns the current listener. More... | |
const HlmsCache * | getMaterial (HlmsCache const *lastReturnedValue, const HlmsCache &passCache, const QueuedRenderable &queuedRenderable, bool casterPass) |
Retrieves an HlmsCache filled with the GPU programs to be used by the given renderable. More... | |
uint16 | getMaxNonCasterDirectionalLights () const |
const String * | getNameStr (IdString name) const |
Returns the string name associated with its hashed name (this was passed as refName in @createDatablock). More... | |
OptimizationStrategy | getOptimizationStrategy () const |
ParallaxCorrectedCubemapBase * | getParallaxCorrectedCubemap () const |
bool | getPerceptualRoughness () const |
const LibraryVec & | getPiecesLibrary () const |
ArchiveVec | getPiecesLibraryAsArchiveVec () const |
size_t | getPoolIndex (ConstBufferPoolUser *user) const |
Gets an ID corresponding to the pool this user was assigned to, unique per hash. More... | |
RenderSystem * | getRenderSystem () const |
const ShaderCodeCacheVec & | getShaderCodeCache () const |
const String & | getShaderProfile () const |
IdString | getShaderSyntax () const |
ShadowFilter | getShadowFilter () const |
bool | getShadowReceiversInPixelShader () const |
void | getTemplateChecksum (uint64 outHash[2]) const |
HlmsTypes | getType () const |
IdString | getTypeName () const |
const String & | getTypeNameStr () const |
bool | getUseLightBuffers () |
bool | getVctFullConeCount () const |
VctLighting * | getVctLighting () |
void | loadLtcMatrix () |
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... | |
virtual void | postCommandBufferExecution (CommandBuffer *commandBuffer) |
This gets called after executing the command buffer. More... | |
virtual void | preCommandBufferExecution (CommandBuffer *commandBuffer) |
This gets called right before executing the command buffer. More... | |
virtual HlmsCache | preparePassHash (const Ogre::CompositorShadowNode *shadowNode, bool casterPass, bool dualParaboloid, SceneManager *sceneManager) |
Called every frame by the Render Queue to cache the properties needed by this pass. More... | |
void | releaseSlot (ConstBufferPoolUser *user) |
Releases a slot requested with requestSlot. More... | |
virtual void | reloadFrom (Archive *newDataFolder, ArchiveVec *libraryFolders=0) |
Destroys all the cached shaders and in the next opportunity will recreate them from the new location. More... | |
void | requestSlot (uint32 hash, ConstBufferPoolUser *user, bool wantsExtraBuffer) |
Requests a slot and fills 'user'. Automatically schedules for update. More... | |
void | resetIblSpecMipmap (uint8 numMipmaps) |
By default we see the reflection textures' mipmaps and store the largest one we found. More... | |
void | saveAllTexturesFromDatablocks (const String &folderPath, set< String >::type &savedTextures, bool saveOitd, bool saveOriginal, HlmsTextureExportListener *listener) |
void | scheduleForUpdate (ConstBufferPoolUser *dirtyUser, uint8 dirtyFlags=DirtyConstBuffer) |
void | setAmbientLightMode (AmbientLightMode mode) |
void | setAreaLightForwardSettings (uint16 areaLightsApproxLimit, uint16 areaLightsLtcLimit) |
Area lights use regular Forward. More... | |
void | setAreaLightMasks (TextureGpu *areaLightMask) |
void | setDebugOutputPath (bool enableDebugOutput, bool outputProperties, const String &path=BLANKSTRING) |
Call to output the automatically generated shaders (which are usually made from templates) on the given folder for inspection, analyzing, debugging, etc. More... | |
void | setDebugPssmSplits (bool bDebug) |
void | setEsmK (uint16 K) |
Sets the 'K' parameter of ESM filter. More... | |
void | setFineLightMaskGranularity (bool useFineGranularity) |
Toggles whether light masks will be obeyed per object by doing: if( movableObject->getLightMask() & light->getLightMask() ) doLighting( movableObject light ); Note this toggle only affects forward lights (i.e. More... | |
void | setHighQuality (bool highQuality) |
Sets the quality of the Hlms. More... | |
void | setIrradianceField (IrradianceField *irradianceField) |
void | setIrradianceVolume (IrradianceVolume *irradianceVolume) |
void | setLightProfilesTexture (TextureGpu *lightProfilesTex) |
void | setListener (HlmsListener *listener) |
Sets a listener to extend an existing Hlms implementation's with custom code, without having to rewrite it or modify the source code directly. More... | |
void | setMaxNonCasterDirectionalLights (uint16 maxLights) |
Non-caster directional lights are hardcoded into shaders. More... | |
virtual void | setOptimizationStrategy (OptimizationStrategy optimizationStrategy) |
Sets the optimization strategy. More... | |
void | setParallaxCorrectedCubemap (ParallaxCorrectedCubemapBase *pcc, float pccVctMinDistance=1.0f, float pccVctMaxDistance=2.0f) |
Sets PCC. More... | |
void | setPerceptualRoughness (bool bPerceptualRoughness) |
Toggle whether the roughness value (set via material parameters and via roughness textures) is perceptual or raw. More... | |
void | setShadowReceiversInPixelShader (bool bInPixelShader) |
Toggles whether light-space position is calculated in vertex or pixel shader. More... | |
void | setShadowSettings (ShadowFilter filter) |
void | setTextureBufferDefaultSize (size_t defaultSize) |
Changes the default suggested size for the texture buffer. More... | |
void | setUseLightBuffers (bool b) |
void | setVctFullConeCount (bool vctFullConeCount) |
When false, we will use 4 cones for diffuse VCT. More... | |
void | setVctLighting (VctLighting *vctLighting) |
Static Public Member Functions | |
static bool | findParamInVec (const HlmsParamVec ¶mVec, IdString key, String &inOut) |
Finds the parameter with key 'key' in the given 'paramVec'. More... | |
static void | getDefaultPaths (String &outDataFolderPath, StringVector &outLibraryFoldersPaths) |
Fill the provided string and string vector with all the sub-folder needed to instantiate an HlmsPbs object with the default distribution of the HlmsResources. More... | |
static int32 | getProperty (const HlmsPropertyVec &properties, IdString key, int32 defaultVal=0) |
Utility helper, mostly useful to HlmsListener implementations. More... | |
static void | setProperty (HlmsPropertyVec &properties, IdString key, int32 value) |
Utility helper, mostly useful to HlmsListener implementations. More... | |
Physically based shading implementation specfically designed for OpenGL 3+, D3D11 and other RenderSystems which support uniform buffers.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Ogre::HlmsPbs::HlmsPbs | ( | Archive * | dataFolder, |
ArchiveVec * | libraryFolders | ||
) |
|
virtual |
|
virtual |
Reimplemented from Ogre::HlmsBufferManager.
|
inherited |
|
virtual |
Reimplemented from Ogre::Hlms.
|
inherited |
|
virtual |
Loads datablock values from a JSON value.
jsonValue | JSON Object containing the definition of this datablock. |
blocks | All the loaded Macro-, Blend- & Samplerblocks the JSON has defined and may be referenced by the datablock declaration. |
datablock | Datablock to fill the values. |
Reimplemented from Ogre::Hlms.
void Ogre::HlmsPbs::_notifyIblSpecMipmap | ( | uint8 | numMipmaps | ) |
|
inlineinherited |
|
virtual |
Reimplemented from Ogre::Hlms.
For debugging stuff. I.e. the Command line uses it for testing manually set properties.
|
inlineinherited |
|
virtual |
Reimplemented from Ogre::Hlms.
|
inherited |
Compiles input properties and adds it to the shader code cache.
codeCache | [in/out] All variables must be filled except for ShaderCodeCache::shaders which is the output |
|
inherited |
Creates a unique datablock that can be shared by multiple renderables.
name | Name of the Datablock, must be unique within all Hlms types, not just this one. 99% you want this to be IdString( refName ); however this is not enforced. |
refName | Name of the Datablock. The engine doesn't use this value at all. It is only useful for UI editors which want to enumerate all existing datablocks and display its name to the user. |
macroblockRef | @See HlmsManager::getMacroblock |
blendblockRef | @See HlmsManager::getBlendblock |
paramVec | Key - String Value list of paramters. MUST BE SORTED. |
visibleToManager | When false, HlmsManager::getDatablock won't find this datablock. True by default |
filename | Filename in which it was defined, so that this information can be retrieved later by the user if needed. This is only for informational purposes. |
resourceGroup | ResourceGroup. See filename param. |
|
inherited |
Destroys all datablocks created with @createDatablock.
Caller is responsible for ensuring those pointers aren't still in use (i.e. dangling pointers) The default datablock will be recreated.
|
inherited |
Destroys a datablocks given its name.
Caller is responsible for ensuring those pointers aren't still in use (i.e. dangling pointers)
|
virtual |
Fills the constant buffers.
Gets executed right before drawing the mesh.
cache | Current cache of Shaders to be used. |
queuedRenderable | The Renderable-MovableObject pair about to be rendered. |
casterPass | Whether this is a shadow mapping caster pass. |
lastCacheHash | The hash of the cache of shaders that was the used by the previous renderable. |
lastTextureHash | Last Texture Hash, used to let the Hlms know whether the textures should be changed again |
Implements Ogre::Hlms.
|
virtual |
Implements Ogre::Hlms.
|
virtual |
Implements Ogre::Hlms.
|
staticinherited |
Finds the parameter with key 'key' in the given 'paramVec'.
If found, outputs the value to 'inOut', otherwise leaves 'inOut' as is.
|
virtual |
Called when the frame has fully ended (ALL passes have been executed to all RTTs)
Reimplemented from Ogre::HlmsBufferManager.
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Finds an existing datablock based on its name (.
|
inlineinherited |
Returns all datablocks owned by this Hlms, including the default one.
|
inlineinherited |
|
inline |
|
inherited |
Datablock to use when another datablock failed or none was specified.
|
static |
Fill the provided string and string vector with all the sub-folder needed to instantiate an HlmsPbs object with the default distribution of the HlmsResources.
These paths are dependent of the current RenderSystem.
This method can only be called after a valid RenderSysttem has been chosen.
All output parameter's content will be replaced with the new set of paths.
outDataFolderPath | Path (as a String) used for creating the "dataFolder" Archive the constructor will need |
outLibraryFoldersPaths | Vector of String used for creating the ArchiveVector "libraryFolders" the constructor will need |
|
inline |
|
inherited |
Returns the filaname & resource group a datablock was created from, and is associated with its hashed name (this was passed as in @createDatablock).
Returns null ptr if not found. Note that it may also be a valid pointer but contain an empty string. The reason this String doesn't live in HlmsDatablock is to prevent cache trashing (datablocks are hot iterated every frame, and the filename & resource groups are rarely ever used) Usage: String const *filename; String const *resourceGroup; datablock->getFilenameAndResourceGroup( &filename, &resourceGroup ); if( filename && resourceGroup && !filename->empty() && !resourceGroup->empty() ) { //Valid filename & resource group. }
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inline |
|
inline |
|
inherited |
Returns the current listener.
|
inherited |
Retrieves an HlmsCache filled with the GPU programs to be used by the given renderable.
If the shaders have already been created (i.e. whether for this renderable, or another one) it gets them from a cache. Otherwise we create it. It assumes that renderable->setHlms( this, parameters ) has already called.
lastReturnedValue | The last value returned by getMaterial. |
passCache | The cache returned by @preparePassHash. |
renderable | The renderable the caller wants us to give the shaders. |
movableObject | The MovableObject owner of the renderable (we need it to know if renderable should cast shadows) |
casterPass | True if this pass is the shadow mapping caster pass, false otherwise |
|
inlineinherited |
Returns the string name associated with its hashed name (this was passed as refName in @createDatablock).
Returns null ptr if not found. The reason this String doesn't live in HlmsDatablock is to prevent cache trashing (datablocks are hot iterated every frame, and the full name is rarely ever used)
|
inherited |
|
inline |
bool Ogre::HlmsPbs::getPerceptualRoughness | ( | ) | const |
|
inlineinherited |
|
inherited |
|
inherited |
Gets an ID corresponding to the pool this user was assigned to, unique per hash.
|
staticinherited |
Utility helper, mostly useful to HlmsListener implementations.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inline |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inline |
|
inline |
void Ogre::HlmsPbs::loadLtcMatrix | ( | ) |
|
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
|
virtual |
This gets called after executing the command buffer.
Reimplemented from Ogre::HlmsBufferManager.
|
virtualinherited |
This gets called right before executing the command buffer.
Reimplemented from Ogre::Hlms.
|
virtual |
Called every frame by the Render Queue to cache the properties needed by this pass.
i.e. Number of PSSM splits, number of shadow casting lights, etc
shadowNode | The shadow node currently in effect. Can be null. |
Reimplemented from Ogre::HlmsBufferManager.
|
inherited |
Releases a slot requested with requestSlot.
|
virtualinherited |
Destroys all the cached shaders and in the next opportunity will recreate them from the new location.
This is very useful for fast iteration and real-time editing of Hlms shader templates.
libraryFolders | When null pointer, the library folders paths won't be changed at all (but still will be reloaded). When non-null pointer, the library folders will be overwriten. Pass an empty container if you want to stop using libraries. |
Reimplemented in Ogre::HlmsCompute.
|
inherited |
Requests a slot and fills 'user'. Automatically schedules for update.
void Ogre::HlmsPbs::resetIblSpecMipmap | ( | uint8 | numMipmaps | ) |
By default we see the reflection textures' mipmaps and store the largest one we found.
By calling resetIblSpecMipmap; you can reset this process thus if a reflection texture with a large number of mipmaps was removed, these textures can be reevaluated
numMipmaps | When 0; we automatically check for reflection texture. When non-zero, we force the number of mipmaps to the specified value |
|
inherited |
|
inherited |
void Ogre::HlmsPbs::setAmbientLightMode | ( | AmbientLightMode | mode | ) |
|
inherited |
Area lights use regular Forward.
areaLightsApproxLimit | Maximum number of area approx lights that will be considered by the shader. Default value is 1. Use 0 to disable area lights. |
Note: There is little to no performance impact for setting this value higher than you need. e.g. If you set areaLightsApproxLimit = 4, but you only have 2 area lights on scene, you'll pay the price of 2 area lights (but the RAM price of 4).
Beware of setting this value too high (e.g. 65535) as the amount of memory space is limited (we cannot exceed 64kb, including unrelated data to lighting, but required to the pass)
areaLightsLtcLimit | Same as areaLightsApproxLimit, but for LTC lights |
void Ogre::HlmsPbs::setAreaLightMasks | ( | TextureGpu * | areaLightMask | ) |
|
inherited |
Call to output the automatically generated shaders (which are usually made from templates) on the given folder for inspection, analyzing, debugging, etc.
enableDebugOutput | Whether to enable or disable dumping the shaders into a folder |
outputProperties | Whether to dump properties and pieces at the beginning of the shader file. This is very useful for determining what caused Ogre to compile a new variation. Note that this setting may not always produce valid shader code in the dumped files (but it we'll still produce valid shader code while at runtime) If you want to compile the dumped file and it is invalid, just strip this info. |
path | Path location on where to dump it. Should end with slash for proper concatenation (i.e. C:/path/ instead of C:/path; or /home/user/ instead of /home/user) |
void Ogre::HlmsPbs::setDebugPssmSplits | ( | bool | bDebug | ) |
void Ogre::HlmsPbs::setEsmK | ( | uint16 | K | ) |
Sets the 'K' parameter of ESM filter.
Defaults to 600. Small values will give weak shadows, and light bleeding (specially if the caster is close to the receiver; particularly noticeable at contact points). It also gives the chance of over darkening to appear (the shadow of a small caster in front of a large caster looks darker; thus the large caster appers like if it were made of glass instead of being solid).
Large values give strong, dark shadows; but the higher the value, the more you push floating point limits. This value is related to K in MiscUtils::setGaussianLogFilterParams. You don't have to set them to the same value; but you'll notice that if you change this value here, you'll likely have to change the log filter's too.
K | In range (0; infinite). |
|
inline |
Toggles whether light masks will be obeyed per object by doing: if( movableObject->getLightMask() & light->getLightMask() ) doLighting( movableObject light ); Note this toggle only affects forward lights (i.e.
Directional lights + shadow casting lights). You may want to see ForwardPlusBase::setFineLightMaskGranularity for control over Forward+ lights.
|
inherited |
Sets the quality of the Hlms.
This function is most relevant for mobile and almost or completely ignored by Desktop. The default value is false.
|
inline |
|
inline |
void Ogre::HlmsPbs::setLightProfilesTexture | ( | TextureGpu * | lightProfilesTex | ) |
|
inherited |
Sets a listener to extend an existing Hlms implementation's with custom code, without having to rewrite it or modify the source code directly.
listener | Listener pointer. Use null to disable. |
|
inherited |
Non-caster directional lights are hardcoded into shaders.
This means that if you have 6 directional lights and then you add a 7th one, a whole new set of shaders will be created.
This setting allows you to tremendously reduce the amount of shader permutations by forcing Ogre to switching to static branching with an upper limit to the max number of non-shadow-casting directional lights.
There is no such switch for shadow-casting directional/point/spot lights because of technical limitations at the GPU level (cannot index shadow map textures in DX11, nor samplers in any known GPU).
maxLights | Maximum number of non-caster directional lights. 0 to allow unlimited number of lights, at the cost of shader recompilations when directional lights are added or removed. |
Default value is 0.
Note: There is little to no performance impact for setting this value higher than you need. e.g. If you set maxLights = 4, but you only have 2 non-caster dir. lights on scene, you'll pay the price of 2 lights (but the RAM price of 4).
Beware of setting this value too high (e.g. 65535) as the amount of memory space is limited (we cannot exceed 64kb, including unrelated data to lighting, but required to the pass)
|
virtualinherited |
Sets the optimization strategy.
See OptimizationStrategy.
Reimplemented in Ogre::HlmsUnlit.
void Ogre::HlmsPbs::setParallaxCorrectedCubemap | ( | ParallaxCorrectedCubemapBase * | pcc, |
float | pccVctMinDistance = 1.0f , |
||
float | pccVctMaxDistance = 2.0f |
||
) |
Sets PCC.
But when they do not, severe distortion could happen.
When both VCT and PCC are active, VCT can be used to determine whether the PCC approximation is accurate. If it is, it uses the PCC result. If it's not, it uses the VCT one (which is accurate but more 'blocky' due to voxelization)
This setting determines how much deviation is allowed and smoothly transition between the VCT and PCC results.
This value only affects specular reflections. For diffuse GI, VCT is always preferred over the cubemap's.
pcc | Pointer to PCC |
pccVctMinDistance | Value in units (e.g. meters, centimeters, whatever your engine uses) Any discrepancy between PCC and VCT below this threshold means PCC reflections will be used. |
The assertion pccVctMinDistance < pccVctMaxDistance must be true. Use a very high pccVctMinDistance to always use PCC
pccVctMaxDistance | Value in units (e.g. meters, centimeters, whatever your engine uses) Any discrepancy between PCC and VCT above this threshold means VCT reflections will be used. |
Errors between pccVctMinDistance & pccVctMaxDistance will be faded smoothly Use negative pccVctMaxDistance to always use VCT
void Ogre::HlmsPbs::setPerceptualRoughness | ( | bool | bPerceptualRoughness | ) |
Toggle whether the roughness value (set via material parameters and via roughness textures) is perceptual or raw.
Ogre 2.1 and 2.2.0 used raw roughness
Ogre 2.2.1+ default to perceptual roughness to better match the output of other PBR tools
If you're porting from Ogre 2.1 you may want to disable this feature unless if you want your materials to look exactly how they did in 2.2.0 and 2.1
See https://forums.ogre3d.org/viewtopic.php?f=25&t=95523
bPerceptualRoughness | True to enable perceptual roughess (default) False to use raw roughess (Ogre 2.1's behavior) |
|
staticinherited |
Utility helper, mostly useful to HlmsListener implementations.
void Ogre::HlmsPbs::setShadowReceiversInPixelShader | ( | bool | bInPixelShader | ) |
Toggles whether light-space position is calculated in vertex or pixel shader.
This position is used for evaluating shadow mapping
Performance: Whether this setting results in higher or lower performance depends on:
1. Vertex count of the scene (high vertex count benefit from bInPixelShader = true) 2. Screen resolution (large resolutions benefit from bInPixelShader = false) 3. Number of shadow mapping lights (large numbers benefit from bInPixelShader = true)
You will have to profile which setting gives you better performance, although generally speaking for low number of lights (e.g. < 5) bInPixelShader = false is more likely to win.
void Ogre::HlmsPbs::setShadowSettings | ( | ShadowFilter | filter | ) |
|
inherited |
Changes the default suggested size for the texture buffer.
Actual size may be lower if the GPU can't honour the request.
void Ogre::HlmsPbs::setUseLightBuffers | ( | bool | b | ) |
|
inline |
When false, we will use 4 cones for diffuse VCT.
When true, we will use 6 cones instead. This is higher quality but consumes more performance and is usually overkill (benefit / cost ratio).
Default value is false
vctFullConeCount |
|
inline |