High-level rendering subsystem. Manages drawing of 3D views. More...

#include <Urho3D/Graphics/Renderer.h>

Inheritance diagram for Urho3D::Renderer:
[legend]
Collaboration diagram for Urho3D::Renderer:
[legend]

Public Types

using ShadowMapFilter = void(Object::*)(View *view, Texture2D *shadowMap, float blurScale)
 

Public Member Functions

 Renderer (Context *context)
 Construct.
 
 ~Renderer () override
 Destruct.
 
void SetNumViewports (unsigned num)
 
void SetViewport (unsigned index, Viewport *viewport)
 
void SetDefaultRenderPath (RenderPath *renderPath)
 
void SetDefaultRenderPath (XMLFile *xmlFile)
 Set default renderpath from an XML file.
 
void SetDefaultTechnique (Technique *technique)
 
void SetHDRRendering (bool enable)
 
void SetSpecularLighting (bool enable)
 
void SetTextureAnisotropy (int level)
 
void SetTextureFilterMode (TextureFilterMode mode)
 
void SetTextureQuality (MaterialQuality quality)
 
void SetMaterialQuality (MaterialQuality quality)
 
void SetDrawShadows (bool enable)
 
void SetShadowMapSize (int size)
 
void SetShadowQuality (ShadowQuality quality)
 
void SetShadowSoftness (float shadowSoftness)
 
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)
 
void SetShadowMapFilter (Object *instance, ShadowMapFilter functionPtr)
 
void SetReuseShadowMaps (bool enable)
 
void SetMaxShadowMaps (int shadowMaps)
 
void SetDynamicInstancing (bool enable)
 
void SetNumExtraInstancingBufferElements (int elements)
 
void SetMinInstances (int instances)
 
void SetMaxSortedInstances (int instances)
 
void SetMaxOccluderTriangles (int triangles)
 
void SetOcclusionBufferSize (int size)
 
void SetOccluderSizeThreshold (float screenSize)
 
void SetThreadedOcclusion (bool enable)
 
void SetMobileShadowBiasMul (float mul)
 
void SetMobileShadowBiasAdd (float add)
 
void SetMobileNormalOffsetMul (float mul)
 
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
 
ViewportGetViewport (unsigned index) const
 
ViewportGetViewportForScene (Scene *scene, unsigned index) const
 Return nth backbuffer viewport associated to a scene. Index 0 returns the first.
 
RenderPathGetDefaultRenderPath () const
 
TechniqueGetDefaultTechnique () const
 
bool GetHDRRendering () const
 
bool GetSpecularLighting () const
 
bool GetDrawShadows () const
 
int GetTextureAnisotropy () const
 
TextureFilterMode GetTextureFilterMode () const
 
MaterialQuality GetTextureQuality () const
 
MaterialQuality GetMaterialQuality () const
 
int GetShadowMapSize () const
 
ShadowQuality GetShadowQuality () const
 
float GetShadowSoftness () const
 
Vector2 GetVSMShadowParameters () const
 
int GetVSMMultiSample () const
 
bool GetReuseShadowMaps () const
 
int GetMaxShadowMaps () const
 
bool GetDynamicInstancing () const
 
int GetNumExtraInstancingBufferElements () const
 
int GetMinInstances () const
 
int GetMaxSortedInstances () const
 
int GetMaxOccluderTriangles () const
 
int GetOcclusionBufferSize () const
 
float GetOccluderSizeThreshold () const
 
bool GetThreadedOcclusion () const
 
float GetMobileShadowBiasMul () const
 
float GetMobileShadowBiasAdd () const
 
float GetMobileNormalOffsetMul () const
 
unsigned GetNumViews () const
 
unsigned GetNumPrimitives () const
 
unsigned GetNumBatches () const
 
unsigned GetNumGeometries (bool allViews=false) const
 
unsigned GetNumLights (bool allViews=false) const
 
unsigned GetNumShadowMaps (bool allViews=false) const
 
unsigned GetNumOccluders (bool allViews=false) const
 
ZoneGetDefaultZone () const
 
MaterialGetDefaultMaterial () const
 
Texture2DGetDefaultLightRamp () const
 
Texture2DGetDefaultLightSpot () const
 
TextureCubeGetFaceSelectCubeMap () const
 Return the shadowed pointlight face selection cube map.
 
TextureCubeGetIndirectionCubeMap () const
 Return the shadowed pointlight indirection cube map.
 
VertexBufferGetInstancingBuffer () const
 Return the instancing vertex buffer.
 
const FrameInfoGetFrameInfo () 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.
 
GeometryGetLightGeometry (Light *light)
 Return volume geometry for a light.
 
GeometryGetQuadGeometry ()
 Return quad geometry used in postprocessing.
 
Texture2DGetShadowMap (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...
 
TextureGetScreenBuffer (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...
 
RenderSurfaceGetDepthStencil (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.
 
OcclusionBufferGetOcclusionBuffer (Camera *camera)
 Allocate an occlusion buffer.
 
CameraGetShadowCamera ()
 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.
 
ViewGetPreparedView (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 RectGetLightScissor (Light *light, Camera *camera)
 Return a scissor rectangle for a light.
 
- Public Member Functions inherited from Urho3D::Object
 Object (Context *context)
 Construct.
 
 ~Object () override
 Destruct. Clean up self from event sender & receiver structures.
 
virtual StringHash GetType () const =0
 
virtual const StringGetTypeName () const =0
 
virtual const TypeInfoGetTypeInfo () 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.
 
VariantMapGetEventDataMap () 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.
 
ContextGetContext () const
 Return execution context.
 
const VariantGetGlobalVar (StringHash key) const
 
const VariantMapGetGlobalVars () const
 
void SetGlobalVar (StringHash key, const Variant &value)
 
ObjectGetSubsystem (StringHash type) const
 Return subsystem by type.
 
ObjectGetEventSender () const
 Return active event sender. Null outside event handling.
 
EventHandlerGetEventHandler () 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 StringGetCategory () const
 
void SetBlockEvents (bool block)
 Block object from sending and receiving events.
 
bool GetBlockEvents () const
 Return sending and receiving events blocking status.
 
- Public Member Functions inherited from Urho3D::RefCounted
 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.
 
RefCountedoperator= (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
 
int WeakRefs () const
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Static Public Member Functions

static ViewGetActualView (View *view)
 Return a view or its source view if it uses one. Used internally for render statistics.
 
- Static Public Member Functions inherited from Urho3D::Object
static const TypeInfoGetTypeInfoStatic ()
 Return type info static.
 

Private Member Functions

 URHO3D_OBJECT (Renderer, Object)
 
void Initialize ()
 Initialize when screen mode initially set.
 
void LoadShaders ()
 Reload shaders.
 
void LoadPassShaders (Pass *pass, Vector< SharedPtr< ShaderVariation > > &vertexShaders, Vector< SharedPtr< ShaderVariation > > &pixelShaders, const BatchQueue &queue)
 Reload shaders for a material pass. The related batch queue is provided in case it has extra shader compilation defines.
 
void ReleaseMaterialShaders ()
 Release shaders used in materials.
 
void ReloadTextures ()
 Reload textures.
 
void CreateGeometries ()
 Create light volume geometries.
 
void CreateInstancingBuffer ()
 Create instancing vertex buffer.
 
void SetIndirectionTextureData ()
 Create point light shadow indirection texture data.
 
void UpdateQueuedViewport (unsigned index)
 Update a queued viewport for rendering. More...
 
void PrepareViewRender ()
 Prepare for rendering of a new view.
 
void RemoveUnusedBuffers ()
 Remove unused occlusion and screen buffers.
 
void ResetShadowMapAllocations ()
 Reset shadow map allocation counts.
 
void ResetScreenBufferAllocations ()
 Reset screem buffer allocation counts.
 
void ResetShadowMaps ()
 Remove all shadow maps. Called when global shadow map resolution or format is changed.
 
void ResetBuffers ()
 Remove all occlusion and screen buffers.
 
String GetShadowVariations () const
 Find variations for shadow shaders.
 
void HandleScreenMode (StringHash eventType, VariantMap &eventData)
 Handle screen mode event.
 
void HandleRenderUpdate (StringHash eventType, VariantMap &eventData)
 Handle render update event.
 
void BlurShadowMap (View *view, Texture2D *shadowMap, float blurScale)
 Blur the shadow map.
 

Private Attributes

WeakPtr< Graphicsgraphics_
 Graphics subsystem.
 
SharedPtr< RenderPathdefaultRenderPath_
 Default renderpath.
 
SharedPtr< TechniquedefaultTechnique_
 Default non-textured material technique.
 
SharedPtr< ZonedefaultZone_
 Default zone.
 
SharedPtr< GeometrydirLightGeometry_
 Directional light quad geometry.
 
SharedPtr< GeometryspotLightGeometry_
 Spot light volume geometry.
 
SharedPtr< GeometrypointLightGeometry_
 Point light volume geometry.
 
SharedPtr< VertexBufferinstancingBuffer_
 Instance stream vertex buffer.
 
SharedPtr< MaterialdefaultMaterial_
 Default material.
 
SharedPtr< Texture2DdefaultLightRamp_
 Default range attenuation texture.
 
SharedPtr< Texture2DdefaultLightSpot_
 Default spotlight attenuation texture.
 
SharedPtr< TextureCubefaceSelectCubeMap_
 Face selection cube map for shadowed pointlights.
 
SharedPtr< TextureCubeindirectionCubeMap_
 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.
 
ObjectshadowMapFilterInstance_ {}
 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 * >, RectlightScissorCache_
 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< StringdeferredLightPSVariations_
 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.
 

Additional Inherited Members

- Protected Attributes inherited from Urho3D::Object
Contextcontext_
 Execution context.
 

Detailed Description

High-level rendering subsystem. Manages drawing of 3D views.

Member Function Documentation

◆ DrawDebugGeometry()

void Urho3D::Renderer::DrawDebugGeometry ( bool  depthTest)

Add debug geometry to the debug renderer.

Todo:
Because debug geometry is per-scene, if two cameras show views of the same area, occlusion is not shown correctly
Here is the call graph for this function:

◆ GetDefaultLightRamp()

Texture2D* Urho3D::Renderer::GetDefaultLightRamp ( ) const
inline

Return the default range attenuation texture.

◆ GetDefaultLightSpot()

Texture2D* Urho3D::Renderer::GetDefaultLightSpot ( ) const
inline

Return the default spotlight attenuation texture.

◆ GetDefaultMaterial()

Material* Urho3D::Renderer::GetDefaultMaterial ( ) const
inline

Return the default material.

◆ GetDefaultRenderPath()

RenderPath * Urho3D::Renderer::GetDefaultRenderPath ( ) const

Return default renderpath.

◆ GetDefaultTechnique()

Technique * Urho3D::Renderer::GetDefaultTechnique ( ) const

Return default non-textured material technique.

◆ GetDefaultZone()

Zone* Urho3D::Renderer::GetDefaultZone ( ) const
inline

Return the default zone.

◆ GetDrawShadows()

bool Urho3D::Renderer::GetDrawShadows ( ) const
inline

Return whether drawing shadows is enabled.

◆ GetDynamicInstancing()

bool Urho3D::Renderer::GetDynamicInstancing ( ) const
inline

Return whether dynamic instancing is in use.

◆ GetHDRRendering()

bool Urho3D::Renderer::GetHDRRendering ( ) const
inline

Return whether HDR rendering is enabled.

◆ GetMaterialQuality()

MaterialQuality Urho3D::Renderer::GetMaterialQuality ( ) const
inline

Return material quality level.

◆ GetMaxOccluderTriangles()

int Urho3D::Renderer::GetMaxOccluderTriangles ( ) const
inline

Return maximum number of occluder triangles.

◆ GetMaxShadowMaps()

int Urho3D::Renderer::GetMaxShadowMaps ( ) const
inline

Return maximum number of shadow maps per resolution.

◆ GetMaxSortedInstances()

int Urho3D::Renderer::GetMaxSortedInstances ( ) const
inline

Return maximum number of sorted instances per batch group.

◆ GetMinInstances()

int Urho3D::Renderer::GetMinInstances ( ) const
inline

Return minimum number of instances required in a batch group to render as instanced.

◆ GetMobileNormalOffsetMul()

float Urho3D::Renderer::GetMobileNormalOffsetMul ( ) const
inline

Return shadow normal offset multiplier for mobile platforms.

◆ GetMobileShadowBiasAdd()

float Urho3D::Renderer::GetMobileShadowBiasAdd ( ) const
inline

Return shadow depth bias addition for mobile platforms.

◆ GetMobileShadowBiasMul()

float Urho3D::Renderer::GetMobileShadowBiasMul ( ) const
inline

Return shadow depth bias multiplier for mobile platforms.

◆ GetNumBatches()

unsigned Urho3D::Renderer::GetNumBatches ( ) const
inline

Return number of batches rendered.

◆ GetNumExtraInstancingBufferElements()

int Urho3D::Renderer::GetNumExtraInstancingBufferElements ( ) const
inline

Return number of extra instancing buffer elements.

◆ GetNumGeometries()

unsigned Urho3D::Renderer::GetNumGeometries ( bool  allViews = false) const

Return number of geometries rendered.

Here is the call graph for this function:

◆ GetNumLights()

unsigned Urho3D::Renderer::GetNumLights ( bool  allViews = false) const

Return number of lights rendered.

Here is the call graph for this function:

◆ GetNumOccluders()

unsigned Urho3D::Renderer::GetNumOccluders ( bool  allViews = false) const

Return number of occluders rendered.

Here is the call graph for this function:

◆ GetNumPrimitives()

unsigned Urho3D::Renderer::GetNumPrimitives ( ) const
inline

Return number of primitives rendered.

◆ GetNumShadowMaps()

unsigned Urho3D::Renderer::GetNumShadowMaps ( bool  allViews = false) const

Return number of shadow maps rendered.

Here is the call graph for this function:

◆ GetNumViewports()

unsigned Urho3D::Renderer::GetNumViewports ( ) const
inline

Return number of backbuffer viewports.

◆ GetNumViews()

unsigned Urho3D::Renderer::GetNumViews ( ) const
inline

Return number of views rendered.

◆ GetOccluderSizeThreshold()

float Urho3D::Renderer::GetOccluderSizeThreshold ( ) const
inline

Return occluder screen size threshold.

◆ GetOcclusionBufferSize()

int Urho3D::Renderer::GetOcclusionBufferSize ( ) const
inline

Return occlusion buffer width.

◆ GetReuseShadowMaps()

bool Urho3D::Renderer::GetReuseShadowMaps ( ) const
inline

Return whether shadow maps are reused.

◆ GetScreenBuffer()

Texture * Urho3D::Renderer::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.

Todo:
Mipmaps disabled for now. Allow to request mipmapped buffer?
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetShadowMap()

Texture2D * Urho3D::Renderer::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.

Todo:
Allow to specify maximum shadow maps per resolution, as smaller shadow maps take less memory
Here is the call graph for this function:

◆ GetShadowMapSize()

int Urho3D::Renderer::GetShadowMapSize ( ) const
inline

Return shadow map resolution.

◆ GetShadowQuality()

ShadowQuality Urho3D::Renderer::GetShadowQuality ( ) const
inline

Return shadow quality.

◆ GetShadowSoftness()

float Urho3D::Renderer::GetShadowSoftness ( ) const
inline

Return shadow softness.

◆ GetSpecularLighting()

bool Urho3D::Renderer::GetSpecularLighting ( ) const
inline

Return whether specular lighting is enabled.

◆ GetTextureAnisotropy()

int Urho3D::Renderer::GetTextureAnisotropy ( ) const
inline

Return default texture max. anisotropy level.

◆ GetTextureFilterMode()

TextureFilterMode Urho3D::Renderer::GetTextureFilterMode ( ) const
inline

Return default texture filtering mode.

◆ GetTextureQuality()

MaterialQuality Urho3D::Renderer::GetTextureQuality ( ) const
inline

Return texture quality level.

◆ GetThreadedOcclusion()

bool Urho3D::Renderer::GetThreadedOcclusion ( ) const
inline

Return whether occlusion rendering is threaded.

◆ GetViewport()

Viewport * Urho3D::Renderer::GetViewport ( unsigned  index) const

Return backbuffer viewport by index.

◆ GetVSMMultiSample()

int Urho3D::Renderer::GetVSMMultiSample ( ) const
inline

Return VSM shadow multisample level.

◆ GetVSMShadowParameters()

Vector2 Urho3D::Renderer::GetVSMShadowParameters ( ) const
inline

Return VSM shadow parameters.

◆ SetDefaultRenderPath()

void Urho3D::Renderer::SetDefaultRenderPath ( RenderPath renderPath)

Set default renderpath.

◆ SetDefaultTechnique()

void Urho3D::Renderer::SetDefaultTechnique ( Technique technique)

Set default non-textured material technique.

◆ SetDrawShadows()

void Urho3D::Renderer::SetDrawShadows ( bool  enable)

Set shadows on/off.

Here is the call graph for this function:

◆ SetDynamicInstancing()

void Urho3D::Renderer::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.

◆ SetHDRRendering()

void Urho3D::Renderer::SetHDRRendering ( bool  enable)

Set HDR rendering on/off.

◆ SetMaterialQuality()

void Urho3D::Renderer::SetMaterialQuality ( MaterialQuality  quality)

Set material quality level. See the QUALITY constants in GraphicsDefs.h.

Here is the call graph for this function:

◆ SetMaxOccluderTriangles()

void Urho3D::Renderer::SetMaxOccluderTriangles ( int  triangles)

Set maximum number of occluder triangles.

Here is the call graph for this function:

◆ SetMaxShadowMaps()

void Urho3D::Renderer::SetMaxShadowMaps ( int  shadowMaps)

Set maximum number of shadow maps created for one resolution. Only has effect if reuse of shadow maps is disabled.

◆ SetMaxSortedInstances()

void Urho3D::Renderer::SetMaxSortedInstances ( int  instances)

Set maximum number of sorted instances per batch group. If exceeded, instances are rendered unsorted.

Here is the call graph for this function:

◆ SetMinInstances()

void Urho3D::Renderer::SetMinInstances ( int  instances)

Set minimum number of instances required in a batch group to render as instanced.

Here is the call graph for this function:

◆ SetMobileNormalOffsetMul()

void Urho3D::Renderer::SetMobileNormalOffsetMul ( float  mul)

Set shadow normal offset multiplier for mobile platforms to counteract possible worse shadow map precision. Default 1.0 (no effect).

◆ SetMobileShadowBiasAdd()

void Urho3D::Renderer::SetMobileShadowBiasAdd ( float  add)

Set shadow depth bias addition for mobile platforms to counteract possible worse shadow map precision. Default 0.0 (no effect).

◆ SetMobileShadowBiasMul()

void Urho3D::Renderer::SetMobileShadowBiasMul ( float  mul)

Set shadow depth bias multiplier for mobile platforms to counteract possible worse shadow map precision. Default 1.0 (no effect).

◆ SetNumExtraInstancingBufferElements()

void Urho3D::Renderer::SetNumExtraInstancingBufferElements ( int  elements)

Set number of extra instancing buffer elements. Default is 0. Extra 4-vectors are available through TEXCOORD7 and further.

Here is the call graph for this function:

◆ SetNumViewports()

void Urho3D::Renderer::SetNumViewports ( unsigned  num)

Set number of backbuffer viewports to render.

◆ SetOccluderSizeThreshold()

void Urho3D::Renderer::SetOccluderSizeThreshold ( float  screenSize)

Set required screen size (1.0 = full screen) for occluders.

Here is the call graph for this function:

◆ SetOcclusionBufferSize()

void Urho3D::Renderer::SetOcclusionBufferSize ( int  size)

Set occluder buffer width.

Here is the call graph for this function:

◆ SetReuseShadowMaps()

void Urho3D::Renderer::SetReuseShadowMaps ( bool  enable)

Set reuse of shadow maps. Default is true. If disabled, also transparent geometry can be shadowed.

◆ SetShadowMapFilter()

void Urho3D::Renderer::SetShadowMapFilter ( Object instance,
ShadowMapFilter  functionPtr 
)

Set post processing filter to the shadow map.

◆ SetShadowMapSize()

void Urho3D::Renderer::SetShadowMapSize ( int  size)

Set shadow map resolution.

Here is the call graph for this function:

◆ SetShadowQuality()

void Urho3D::Renderer::SetShadowQuality ( ShadowQuality  quality)

Set shadow quality mode. See the SHADOWQUALITY enum in GraphicsDefs.h.

Here is the caller graph for this function:

◆ SetShadowSoftness()

void Urho3D::Renderer::SetShadowSoftness ( float  shadowSoftness)

Set shadow softness, only works when SHADOWQUALITY_BLUR_VSM is used.

Here is the call graph for this function:

◆ SetSpecularLighting()

void Urho3D::Renderer::SetSpecularLighting ( bool  enable)

Set specular lighting on/off.

◆ SetTextureAnisotropy()

void Urho3D::Renderer::SetTextureAnisotropy ( int  level)

Set default texture max anisotropy level.

Here is the call graph for this function:

◆ SetTextureFilterMode()

void Urho3D::Renderer::SetTextureFilterMode ( TextureFilterMode  mode)

Set default texture filtering.

◆ SetTextureQuality()

void Urho3D::Renderer::SetTextureQuality ( MaterialQuality  quality)

Set texture quality level. See the QUALITY constants in GraphicsDefs.h.

Here is the call graph for this function:

◆ SetThreadedOcclusion()

void Urho3D::Renderer::SetThreadedOcclusion ( bool  enable)

Set whether to thread occluder rendering. Default false.

◆ SetViewport()

void Urho3D::Renderer::SetViewport ( unsigned  index,
Viewport viewport 
)

Set a backbuffer viewport.

◆ SetVSMMultiSample()

void Urho3D::Renderer::SetVSMMultiSample ( int  multiSample)

Set VSM shadow map multisampling level. Default 1 (no multisampling).

Here is the call graph for this function:

◆ UpdateQueuedViewport()

void Urho3D::Renderer::UpdateQueuedViewport ( unsigned  index)
private

Update a queued viewport for rendering.

Todo:
May result in incorrect debug geometry culling if the same scene is drawn from multiple viewports
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • Source/Urho3D/Graphics/Renderer.h
  • Source/Urho3D/Graphics/Renderer.cpp