|
| Renderer (Context *context) |
| Construct.
|
|
| ~Renderer () override |
| Destruct.
|
|
void | SetNumViewports (unsigned num) |
| Set number of backbuffer viewports to render.
|
|
void | SetViewport (unsigned index, Viewport *viewport) |
| Set a backbuffer viewport.
|
|
void | SetDefaultRenderPath (RenderPath *renderPath) |
| Set default renderpath.
|
|
void | SetDefaultRenderPath (XMLFile *xmlFile) |
| Set default renderpath from an XML file.
|
|
void | SetDefaultTechnique (Technique *technique) |
| Set default non-textured material technique.
|
|
void | SetHDRRendering (bool enable) |
| Set HDR rendering on/off.
|
|
void | SetSpecularLighting (bool enable) |
| Set specular lighting on/off.
|
|
void | SetTextureAnisotropy (int level) |
| Set default texture max anisotropy level.
|
|
void | SetTextureFilterMode (TextureFilterMode mode) |
| Set default texture filtering.
|
|
void | SetTextureQuality (MaterialQuality quality) |
| Set texture quality level. See the QUALITY constants in GraphicsDefs.h.
|
|
void | SetMaterialQuality (MaterialQuality quality) |
| Set material quality level. See the QUALITY constants in GraphicsDefs.h.
|
|
void | SetDrawShadows (bool enable) |
| Set shadows on/off.
|
|
void | SetShadowMapSize (int size) |
| Set shadow map resolution.
|
|
void | SetShadowQuality (ShadowQuality quality) |
| Set shadow quality mode. See the SHADOWQUALITY enum in GraphicsDefs.h.
|
|
void | SetShadowSoftness (float shadowSoftness) |
| Set shadow softness, only works when SHADOWQUALITY_BLUR_VSM is used.
|
|
void | SetVSMShadowParameters (float minVariance, float lightBleedingReduction) |
| Set shadow parameters when VSM is used, they help to reduce light bleeding. LightBleeding must be in [0, 1[.
|
|
void | SetVSMMultiSample (int multiSample) |
| Set VSM shadow map multisampling level. Default 1 (no multisampling.)
|
|
void | SetShadowMapFilter (Object *instance, ShadowMapFilter functionPtr) |
| Set post processing filter to the shadow map.
|
|
void | SetReuseShadowMaps (bool enable) |
| Set reuse of shadow maps. Default is true. If disabled, also transparent geometry can be shadowed.
|
|
void | SetMaxShadowMaps (int shadowMaps) |
| Set maximum number of shadow maps created for one resolution. Only has effect if reuse of shadow maps is disabled.
|
|
void | SetDynamicInstancing (bool enable) |
| Set dynamic instancing on/off. When on (default), drawables using the same static-type geometry and material will be automatically combined to an instanced draw call.
|
|
void | SetNumExtraInstancingBufferElements (int elements) |
| Set number of extra instancing buffer elements. Default is 0. Extra 4-vectors are available through TEXCOORD7 and further.
|
|
void | SetMinInstances (int instances) |
| Set minimum number of instances required in a batch group to render as instanced.
|
|
void | SetMaxSortedInstances (int instances) |
| Set maximum number of sorted instances per batch group. If exceeded, instances are rendered unsorted.
|
|
void | SetMaxOccluderTriangles (int triangles) |
| Set maximum number of occluder triangles.
|
|
void | SetOcclusionBufferSize (int size) |
| Set occluder buffer width.
|
|
void | SetOccluderSizeThreshold (float screenSize) |
| Set required screen size (1.0 = full screen) for occluders.
|
|
void | SetThreadedOcclusion (bool enable) |
| Set whether to thread occluder rendering. Default false.
|
|
void | SetMobileShadowBiasMul (float mul) |
| Set shadow depth bias multiplier for mobile platforms to counteract possible worse shadow map precision. Default 1.0 (no effect.)
|
|
void | SetMobileShadowBiasAdd (float add) |
| Set shadow depth bias addition for mobile platforms to counteract possible worse shadow map precision. Default 0.0 (no effect.)
|
|
void | SetMobileNormalOffsetMul (float mul) |
| Set shadow normal offset multiplier for mobile platforms to counteract possible worse shadow map precision. Default 1.0 (no effect.)
|
|
void | ReloadShaders () |
| Force reload of shaders.
|
|
void | ApplyShadowMapFilter (View *view, Texture2D *shadowMap, float blurScale) |
| Apply post processing filter to the shadow map. Called by View.
|
|
unsigned | GetNumViewports () const |
| Return number of backbuffer viewports.
|
|
Viewport * | GetViewport (unsigned index) const |
| Return backbuffer viewport by index.
|
|
Viewport * | GetViewportForScene (Scene *scene, unsigned index) const |
| Return nth backbuffer viewport associated to a scene. Index 0 returns the first.
|
|
RenderPath * | GetDefaultRenderPath () const |
| Return default renderpath.
|
|
Technique * | GetDefaultTechnique () const |
| Return default non-textured material technique.
|
|
bool | GetHDRRendering () const |
| Return whether HDR rendering is enabled.
|
|
bool | GetSpecularLighting () const |
| Return whether specular lighting is enabled.
|
|
bool | GetDrawShadows () const |
| Return whether drawing shadows is enabled.
|
|
int | GetTextureAnisotropy () const |
| Return default texture max. anisotropy level.
|
|
TextureFilterMode | GetTextureFilterMode () const |
| Return default texture filtering mode.
|
|
MaterialQuality | GetTextureQuality () const |
| Return texture quality level.
|
|
MaterialQuality | GetMaterialQuality () const |
| Return material quality level.
|
|
int | GetShadowMapSize () const |
| Return shadow map resolution.
|
|
ShadowQuality | GetShadowQuality () const |
| Return shadow quality.
|
|
float | GetShadowSoftness () const |
| Return shadow softness.
|
|
Vector2 | GetVSMShadowParameters () const |
| Return VSM shadow parameters.
|
|
int | GetVSMMultiSample () const |
| Return VSM shadow multisample level.
|
|
bool | GetReuseShadowMaps () const |
| Return whether shadow maps are reused.
|
|
int | GetMaxShadowMaps () const |
| Return maximum number of shadow maps per resolution.
|
|
bool | GetDynamicInstancing () const |
| Return whether dynamic instancing is in use.
|
|
int | GetNumExtraInstancingBufferElements () const |
| Return number of extra instancing buffer elements.
|
|
int | GetMinInstances () const |
| Return minimum number of instances required in a batch group to render as instanced.
|
|
int | GetMaxSortedInstances () const |
| Return maximum number of sorted instances per batch group.
|
|
int | GetMaxOccluderTriangles () const |
| Return maximum number of occluder triangles.
|
|
int | GetOcclusionBufferSize () const |
| Return occlusion buffer width.
|
|
float | GetOccluderSizeThreshold () const |
| Return occluder screen size threshold.
|
|
bool | GetThreadedOcclusion () const |
| Return whether occlusion rendering is threaded.
|
|
float | GetMobileShadowBiasMul () const |
| Return shadow depth bias multiplier for mobile platforms.
|
|
float | GetMobileShadowBiasAdd () const |
| Return shadow depth bias addition for mobile platforms.
|
|
float | GetMobileNormalOffsetMul () const |
| Return shadow normal offset multiplier for mobile platforms.
|
|
unsigned | GetNumViews () const |
| Return number of views rendered.
|
|
unsigned | GetNumPrimitives () const |
| Return number of primitives rendered.
|
|
unsigned | GetNumBatches () const |
| Return number of batches rendered.
|
|
unsigned | GetNumGeometries (bool allViews=false) const |
| Return number of geometries rendered.
|
|
unsigned | GetNumLights (bool allViews=false) const |
| Return number of lights rendered.
|
|
unsigned | GetNumShadowMaps (bool allViews=false) const |
| Return number of shadow maps rendered.
|
|
unsigned | GetNumOccluders (bool allViews=false) const |
| Return number of occluders rendered.
|
|
Zone * | GetDefaultZone () const |
| Return the default zone.
|
|
Material * | GetDefaultMaterial () const |
| Return the default material.
|
|
Texture2D * | GetDefaultLightRamp () const |
| Return the default range attenuation texture.
|
|
Texture2D * | GetDefaultLightSpot () const |
| Return the default spotlight attenuation texture.
|
|
TextureCube * | GetFaceSelectCubeMap () const |
| Return the shadowed pointlight face selection cube map.
|
|
TextureCube * | GetIndirectionCubeMap () const |
| Return the shadowed pointlight indirection cube map.
|
|
VertexBuffer * | GetInstancingBuffer () const |
| Return the instancing vertex buffer.
|
|
const FrameInfo & | GetFrameInfo () const |
| Return the frame update parameters.
|
|
void | Update (float timeStep) |
| Update for rendering. Called by HandleRenderUpdate().
|
|
void | Render () |
| Render. Called by Engine.
|
|
void | DrawDebugGeometry (bool depthTest) |
| Add debug geometry to the debug renderer. More...
|
|
void | QueueRenderSurface (RenderSurface *renderTarget) |
| Queue a render surface's viewports for rendering. Called by the surface, or by View.
|
|
void | QueueViewport (RenderSurface *renderTarget, Viewport *viewport) |
| Queue a viewport for rendering. Null surface means backbuffer.
|
|
Geometry * | GetLightGeometry (Light *light) |
| Return volume geometry for a light.
|
|
Geometry * | GetQuadGeometry () |
| Return quad geometry used in postprocessing.
|
|
Texture2D * | GetShadowMap (Light *light, Camera *camera, unsigned viewWidth, unsigned viewHeight) |
| Allocate a shadow map. If shadow map reuse is disabled, a different map is returned each time. More...
|
|
Texture * | GetScreenBuffer (int width, int height, unsigned format, int multiSample, bool autoResolve, bool cubemap, bool filtered, bool srgb, unsigned persistentKey=0) |
| Allocate a rendertarget or depth-stencil texture for deferred rendering or postprocessing. Should only be called during actual rendering, not before. More...
|
|
RenderSurface * | GetDepthStencil (int width, int height, int multiSample, bool autoResolve) |
| Allocate a depth-stencil surface that does not need to be readable. Should only be called during actual rendering, not before.
|
|
OcclusionBuffer * | GetOcclusionBuffer (Camera *camera) |
| Allocate an occlusion buffer.
|
|
Camera * | GetShadowCamera () |
| Allocate a temporary shadow camera and a scene node for it. Is thread-safe.
|
|
void | StorePreparedView (View *view, Camera *camera) |
| Mark a view as prepared by the specified culling camera.
|
|
View * | GetPreparedView (Camera *camera) |
| Return a prepared view if exists for the specified camera. Used to avoid duplicate view preparation CPU work.
|
|
void | SetBatchShaders (Batch &batch, Technique *tech, bool allowShadows, const BatchQueue &queue) |
| Choose shaders for a forward rendering batch. The related batch queue is provided in case it has extra shader compilation defines.
|
|
void | SetLightVolumeBatchShaders (Batch &batch, Camera *camera, const String &vsName, const String &psName, const String &vsDefines, const String &psDefines) |
| Choose shaders for a deferred light volume batch.
|
|
void | SetCullMode (CullMode mode, Camera *camera) |
| Set cull mode while taking possible projection flipping into account.
|
|
bool | ResizeInstancingBuffer (unsigned numInstances) |
| Ensure sufficient size of the instancing vertex buffer. Return true if successful.
|
|
void | OptimizeLightByScissor (Light *light, Camera *camera) |
| Optimize a light by scissor rectangle.
|
|
void | OptimizeLightByStencil (Light *light, Camera *camera) |
| Optimize a light by marking it to the stencil buffer and setting a stencil test.
|
|
const Rect & | GetLightScissor (Light *light, Camera *camera) |
| Return a scissor rectangle for a light.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
| Return type hash.
|
|
virtual const String & | GetTypeName () const =0 |
| Return type name.
|
|
virtual const TypeInfo * | GetTypeInfo () const =0 |
| Return type info.
|
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
|
bool | IsInstanceOf (StringHash type) const |
| Check current instance is type of specified type.
|
|
bool | IsInstanceOf (const TypeInfo *typeInfo) const |
| Check current instance is type of specified type.
|
|
template<typename T > |
bool | IsInstanceOf () const |
| Check current instance is type of specified class.
|
|
template<typename T > |
T * | Cast () |
| Cast the object to specified most derived class.
|
|
template<typename T > |
const T * | Cast () const |
| Cast the object to specified most derived class.
|
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
|
void | SubscribeToEvent (StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to a specific sender's event.
|
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events.)
|
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
VariantMap & | GetEventDataMap () const |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
template<typename... Args> |
void | SendEvent (StringHash eventType, Args... args) |
| Send event with variadic parameter pairs to all subscribers. The parameter pairs is a list of paramID and paramValue separated by comma, one pair after another.
|
|
Context * | GetContext () const |
| Return execution context.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
| Return global variable based on key.
|
|
const VariantMap & | GetGlobalVars () const |
| Return all global variables.
|
|
void | SetGlobalVar (StringHash key, const Variant &value) |
| Set global variable with the respective key and value.
|
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
|
bool | HasEventHandlers () const |
| Return whether has subscribed to any event.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
const String & | GetCategory () const |
| Return object category. Categories are (optionally) registered along with the object factory. Return an empty string if the object category is not registered.
|
|
void | SetBlockEvents (bool block) |
| Block object from sending and receiving events.
|
|
bool | GetBlockEvents () const |
| Return sending and receiving events blocking status.
|
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
|
| RefCounted (const RefCounted &rhs)=delete |
| Prevent copy construction.
|
|
RefCounted & | operator= (const RefCounted &rhs)=delete |
| Prevent assignment.
|
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
|
int | Refs () const |
| Return reference count.
|
|
int | WeakRefs () const |
| Return weak reference count.
|
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|
|
WeakPtr< Graphics > | graphics_ |
| Graphics subsystem.
|
|
SharedPtr< RenderPath > | defaultRenderPath_ |
| Default renderpath.
|
|
SharedPtr< Technique > | defaultTechnique_ |
| Default non-textured material technique.
|
|
SharedPtr< Zone > | defaultZone_ |
| Default zone.
|
|
SharedPtr< Geometry > | dirLightGeometry_ |
| Directional light quad geometry.
|
|
SharedPtr< Geometry > | spotLightGeometry_ |
| Spot light volume geometry.
|
|
SharedPtr< Geometry > | pointLightGeometry_ |
| Point light volume geometry.
|
|
SharedPtr< VertexBuffer > | instancingBuffer_ |
| Instance stream vertex buffer.
|
|
SharedPtr< Material > | defaultMaterial_ |
| Default material.
|
|
SharedPtr< Texture2D > | defaultLightRamp_ |
| Default range attenuation texture.
|
|
SharedPtr< Texture2D > | defaultLightSpot_ |
| Default spotlight attenuation texture.
|
|
SharedPtr< TextureCube > | faceSelectCubeMap_ |
| Face selection cube map for shadowed pointlights.
|
|
SharedPtr< TextureCube > | indirectionCubeMap_ |
| Indirection cube map for shadowed pointlights.
|
|
Vector< SharedPtr< Node > > | shadowCameraNodes_ |
| Reusable scene nodes with shadow camera components.
|
|
Vector< SharedPtr< OcclusionBuffer > > | occlusionBuffers_ |
| Reusable occlusion buffers.
|
|
HashMap< int, Vector< SharedPtr< Texture2D > > > | shadowMaps_ |
| Shadow maps by resolution.
|
|
HashMap< int, SharedPtr< Texture2D > > | colorShadowMaps_ |
| Shadow map dummy color buffers by resolution.
|
|
HashMap< int, PODVector< Light * > > | shadowMapAllocations_ |
| Shadow map allocations by resolution.
|
|
Object * | shadowMapFilterInstance_ {} |
| Instance of shadow map filter.
|
|
ShadowMapFilter | shadowMapFilter_ {} |
| Function pointer of shadow map filter.
|
|
HashMap< unsigned long long, Vector< SharedPtr< Texture > > > | screenBuffers_ |
| Screen buffers by resolution and format.
|
|
HashMap< unsigned long long, unsigned > | screenBufferAllocations_ |
| Current screen buffer allocations by resolution and format.
|
|
HashMap< Pair< Light *, Camera * >, Rect > | lightScissorCache_ |
| Cache for light scissor queries.
|
|
Vector< SharedPtr< Viewport > > | viewports_ |
| Backbuffer viewports.
|
|
Vector< Pair< WeakPtr< RenderSurface >, WeakPtr< Viewport > > > | queuedViewports_ |
| Render surface viewports queued for update.
|
|
Vector< WeakPtr< View > > | views_ |
| Views that have been processed this frame.
|
|
HashMap< Camera *, WeakPtr< View > > | preparedViews_ |
| Prepared views by culling camera.
|
|
HashSet< Octree * > | updatedOctrees_ |
| Octrees that have been updated during the frame.
|
|
HashSet< Technique * > | shaderErrorDisplayed_ |
| Techniques for which missing shader error has been displayed.
|
|
Mutex | rendererMutex_ |
| Mutex for shadow camera allocation.
|
|
Vector< String > | deferredLightPSVariations_ |
| Current variation names for deferred light volume shaders.
|
|
FrameInfo | frame_ |
| Frame info for rendering.
|
|
int | textureAnisotropy_ {4} |
| Texture anisotropy level.
|
|
TextureFilterMode | textureFilterMode_ {FILTER_TRILINEAR} |
| Texture filtering mode.
|
|
MaterialQuality | textureQuality_ {QUALITY_HIGH} |
| Texture quality level.
|
|
MaterialQuality | materialQuality_ {QUALITY_HIGH} |
| Material quality level.
|
|
int | shadowMapSize_ {1024} |
| Shadow map resolution.
|
|
ShadowQuality | shadowQuality_ {SHADOWQUALITY_PCF_16BIT} |
| Shadow quality.
|
|
float | shadowSoftness_ {1.0f} |
| Shadow softness, only works when SHADOWQUALITY_BLUR_VSM is used.
|
|
Vector2 | vsmShadowParams_ {0.0000001f, 0.9f} |
| Shadow parameters when VSM is used, they help to reduce light bleeding.
|
|
int | vsmMultiSample_ {1} |
| Multisample level for VSM shadows.
|
|
int | maxShadowMaps_ {1} |
| Maximum number of shadow maps per resolution.
|
|
int | minInstances_ {2} |
| Minimum number of instances required in a batch group to render as instanced.
|
|
int | maxSortedInstances_ {1000} |
| Maximum sorted instances per batch group.
|
|
int | maxOccluderTriangles_ {5000} |
| Maximum occluder triangles.
|
|
int | occlusionBufferSize_ {256} |
| Occlusion buffer width.
|
|
float | occluderSizeThreshold_ {0.025f} |
| Occluder screen size threshold.
|
|
float | mobileShadowBiasMul_ {1.0f} |
| Mobile platform shadow depth bias multiplier.
|
|
float | mobileShadowBiasAdd_ {} |
| Mobile platform shadow depth bias addition.
|
|
float | mobileNormalOffsetMul_ {1.0f} |
| Mobile platform shadow normal offset multiplier.
|
|
unsigned | numOcclusionBuffers_ {} |
| Number of occlusion buffers in use.
|
|
unsigned | numShadowCameras_ {} |
| Number of temporary shadow cameras in use.
|
|
unsigned | numPrimitives_ {} |
| Number of primitives (3D geometry only.)
|
|
unsigned | numBatches_ {} |
| Number of batches (3D geometry only.)
|
|
unsigned | shadersChangedFrameNumber_ {M_MAX_UNSIGNED} |
| Frame number on which shaders last changed.
|
|
unsigned char | lightStencilValue_ {} |
| Current stencil value for light optimization.
|
|
bool | hdrRendering_ {} |
| HDR rendering flag.
|
|
bool | specularLighting_ {true} |
| Specular lighting flag.
|
|
bool | drawShadows_ {true} |
| Draw shadows flag.
|
|
bool | reuseShadowMaps_ {true} |
| Shadow map reuse flag.
|
|
bool | dynamicInstancing_ {true} |
| Dynamic instancing flag.
|
|
int | numExtraInstancingBufferElements_ {} |
| Number of extra instancing data elements.
|
|
bool | threadedOcclusion_ {} |
| Threaded occlusion rendering flag.
|
|
bool | shadersDirty_ {true} |
| Shaders need reloading flag.
|
|
bool | initialized_ {} |
| Initialized flag.
|
|
bool | resetViews_ {} |
| Flag for views needing reset.
|
|