$#include "Renderer.h" /// High-level rendering subsystem. Manages drawing of 3D views. class Renderer { public: /// Set number of backbuffer viewports to render. void SetNumViewports(unsigned num); /// Set a backbuffer viewport. void SetViewport(unsigned index, Viewport* viewport); /// Set default renderpath. void SetDefaultRenderPath(RenderPath* renderPath); /// Set default renderpath from an XML file. void SetDefaultRenderPath(XMLFile* file); /// Set specular lighting on/off. void SetSpecularLighting(bool enable); /// Set texture anisotropy. void SetTextureAnisotropy(int level); /// Set texture filtering. void SetTextureFilterMode(TextureFilterMode mode); /// Set texture quality level. void SetTextureQuality(int quality); /// Set material quality level. void SetMaterialQuality(int quality); /// Set shadows on/off. void SetDrawShadows(bool enable); /// Set shadow map resolution. void SetShadowMapSize(int size); /// Set shadow quality (amount of samples and bit depth.) void SetShadowQuality(int quality); /// Set reuse of shadow maps. Default is true. If disabled, also transparent geometry can be shadowed. void SetReuseShadowMaps(bool enable); /// Set maximum number of shadow maps created for one resolution. Only has effect if reuse of shadow maps is disabled. void SetMaxShadowMaps(int shadowMaps); /// Set maximum number of directional light shadow map cascades. Affects the size of directional light shadow maps. void SetMaxShadowCascades(int cascades); /// Set dynamic instancing on/off. void SetDynamicInstancing(bool enable); /// Set minimum number of instances required in a batch group to render as instanced. void SetMinInstances(int instances); /// Set maximum number of triangles per object for instancing. void SetMaxInstanceTriangles(int triangles); /// Set maximum number of sorted instances per batch group. If exceeded, instances are rendered unsorted. void SetMaxSortedInstances(int instances); /// Set maximum number of occluder trianges. void SetMaxOccluderTriangles(int triangles); /// Set occluder buffer width. void SetOcclusionBufferSize(int size); /// Set required screen size (1.0 = full screen) for occluders. void SetOccluderSizeThreshold(float screenSize); /// Force reload of shaders. void ReloadShaders(); /// Return number of backbuffer viewports. unsigned GetNumViewports() const; /// Return backbuffer viewport by index. Viewport* GetViewport(unsigned index) const; /// Return default renderpath. RenderPath* GetDefaultRenderPath() const; /// Return whether specular lighting is enabled. bool GetSpecularLighting() const; /// Return whether drawing shadows is enabled. bool GetDrawShadows() const; /// Return texture anisotropy. int GetTextureAnisotropy() const; /// Return texture filtering. TextureFilterMode GetTextureFilterMode() const; /// Return texture quality level. int GetTextureQuality() const; /// Return material quality level. int GetMaterialQuality() const; /// Return shadow map resolution. int GetShadowMapSize() const; /// Return shadow quality. int GetShadowQuality() const; /// Return whether shadow maps are reused. bool GetReuseShadowMaps() const; /// Return maximum number of shadow maps per resolution. int GetMaxShadowMaps() const; /// Return maximum number of directional light shadow map cascades. int GetMaxShadowCascades() const; /// Return whether dynamic instancing is in use. bool GetDynamicInstancing() const; /// Return minimum number of instances required in a batch group to render as instanced. int GetMinInstances() const; /// Return maximum number of triangles per object for instancing. int GetMaxInstanceTriangles() const; /// Return maximum number of sorted instances per batch group. int GetMaxSortedInstances() const; /// Return maximum number of occluder triangles. int GetMaxOccluderTriangles() const; /// Return occlusion buffer width. int GetOcclusionBufferSize() const; /// Return occluder screen size threshold. float GetOccluderSizeThreshold() const; /// Return number of views rendered. unsigned GetNumViews() const; /// Return number of primitives rendered. unsigned GetNumPrimitives() const; /// Return number of batches rendered. unsigned GetNumBatches() const; /// Return number of geometries rendered. unsigned GetNumGeometries(bool allViews = false) const; /// Return number of lights rendered. unsigned GetNumLights(bool allViews = false) const; /// Return number of shadow maps rendered. unsigned GetNumShadowMaps(bool allViews = false) const; /// Return number of occluders rendered. unsigned GetNumOccluders(bool allViews = false) const; /// Return the default zone. Zone* GetDefaultZone() const; /// Return the directional light for fullscreen quad rendering. Light* GetQuadDirLight() const; /// Return the default material. Material* GetDefaultMaterial() const; /// Return the default range attenuation texture. Texture2D* GetDefaultLightRamp() const; /// Return the default spotlight attenuation texture. Texture2D* GetDefaultLightSpot() const; /// Return the shadowed pointlight face selection cube map. TextureCube* GetFaceSelectCubeMap() const; /// Return the shadowed pointlight indirection cube map. TextureCube* GetIndirectionCubeMap() const; /// Return the instancing vertex buffer VertexBuffer* GetInstancingBuffer() const; /// Return a vertex shader by name. ShaderVariation* GetVertexShader(const String& name, bool checkExists = false) const; /// Return a pixel shader by name. ShaderVariation* GetPixelShader(const String& name, bool checkExists = false) const; /// Return the stencil vertex shader. ShaderVariation* GetStencilVS() const; /// Return the stencil pixel shader. ShaderVariation* GetStencilPS() const; /// Return the frame update parameters. const FrameInfo& GetFrameInfo(); }; Renderer* GetRenderer();