IRenderer

Main interface to the renderer implementation, wrapping the low-level graphics API. More...

#include

Classes

struct SLoadShaderItemArgs
Load shader item for name (name). More...

Public Types

enum EViewportType : uint8 { eViewportType_Default, eViewportType_Secondary }
typedef std::map< IRenderMesh *, IRenderer::SDrawCallCountInfo > RNDrawcallsMapMesh
Debug draw call info (per mesh).

Public Member Functions

virtual void AddListener (IRendererEventListener *pRendererEventListener)=0
virtual void RemoveListener (IRendererEventListener *pRendererEventListener)=0
virtual ERenderType GetRenderType () const =0
virtual WIN_HWND Init (int x, int y, int width, int height, unsigned int cbpp, int zbpp, int sbits, WIN_HWND Glhwnd=0, bool bReInit=false, bool bShaderCacheGen=false)=0
Initializes the renderer, parameters are self-explanatory.
virtual void PostInit ()=0
virtual void StartRenderIntroMovies ()=0
Start active rendering of the intro movies while initializing the rest of the engine.
virtual void StopRenderIntroMovies (bool bWaitForFinished)=0
virtual bool IsRenderingIntroMovies () const =0
virtual bool IsPost3DRendererEnabled () const
virtual void ExecuteAsyncDIP ()=0
virtual int GetFeatures ()=0
virtual void GetVideoMemoryUsageStats (size_t &vidMemUsedThisFrame, size_t &vidMemUsedRecently, bool bGetPoolsSizes=false)=0
virtual int GetNumGeomInstances ()=0
virtual int GetNumGeomInstanceDrawCalls ()=0
virtual int GetCurrentNumberOfDrawCalls ()=0
virtual void GetCurrentNumberOfDrawCalls (int &nGeneral, int &nShadowGen)=0
virtual int GetCurrentNumberOfDrawCalls (const uint32 EFSListMask)=0
virtual void SetDebugRenderNode (IRenderNode *pRenderNode)=0
virtual bool IsDebugRenderNode (IRenderNode *pRenderNode) const =0
virtual bool CreateContext (const SDisplayContextDescription &desc)=0
virtual void ResizeContext (CryDisplayContextHandle hWnd, int width, int height)=0
virtual bool DeleteContext (CryDisplayContextHandle hWnd)=0
virtual void ShutDown (bool bReInit=false)=0
Shuts down the renderer.
virtual void ShutDownFast ()=0
virtual int EnumDisplayFormats (SDispFormat *Formats)=0
virtual void BeginFrame (CryDisplayContextHandle hWnd)=0
Should be called at the beginning of every frame.
virtual void FillFrame (ColorF clearColor)=0
Should be called at the beginning of every frame.
virtual void InitSystemResources (int nFlags)=0
Creates default system shaders and textures.
virtual void FreeSystemResources (int nFlags)=0
Frees the allocated resources.
virtual void Release ()=0
Shuts down the renderer.
virtual void RenderDebug (bool bRenderStats=true)=0
virtual void EndFrame ()=0
Should be called at the end of every frame.
virtual void TryFlush ()=0
Try to flush the render thread commands to keep the render thread active during level loading, but simpy return if the render thread is still busy.
virtual Vec2 SetViewportDownscale (float xscale, float yscale)=0
virtual CRenderView * GetOrCreateRenderView (IRenderView::EViewType Type=IRenderView::eViewType_Default)=0
virtual void ReturnRenderView (CRenderView *pRenderView)=0
virtual bool SetGammaDelta (const float fGamma)=0
Set delta gamma.
virtual void RestoreGamma (void)=0
Reset gamma setting if not in fullscreen mode.
virtual bool SaveTga (unsigned char *sourcedata, int sourceformat, int w, int h, const char *filename, bool flip) const =0
Saves source data to a Tga file.
virtual int GetWhiteTextureId () const =0
Gets the white texture Id.
virtual int GetDetailedRayHitInfo (IPhysicalEntity *pCollider, const Vec3 &vOrigin, const Vec3 &vDirection, const float maxRayDist, float *pUOut, float *pVOut)=0
Used for calculating the hit uv-coordinates from a raycast.
virtual Vec3 UnprojectFromScreen (int x, int y)=0
Turns screen point into vector that is projected into scene, from the current view.
virtual int GetHeight ()=0
Gets height of the main rendering resolution.
virtual int GetWidth ()=0
Gets width of the main rendering resolution.
virtual float GetPixelAspectRatio () const =0
Gets Pixel Aspect Ratio.
virtual int GetOverlayHeight ()=0
Gets width of the height of the overlay viewport where UI and debug output are rendered.
virtual int GetOverlayWidth ()=0
Gets width of the width of the overlay viewport where UI and debug output are rendered.
virtual void GetMemoryUsage (ICrySizer *Sizer)=0
Gets memory status information.
virtual void GetBandwidthStats (float *fBandwidthRequested)=0
Gets textures streaming bandwidth information.
virtual void SetTextureStreamListener (ITextureStreamListener *pListener)=0
Sets an event listener for texture streaming updates.
virtual float * PinOcclusionBuffer (Matrix44A &camera)=0
virtual void UnpinOcclusionBuffer ()=0
virtual int GetColorBpp ()=0
Get current bpp.
virtual int GetDepthBpp ()=0
Get current z-buffer depth.
virtual int GetStencilBpp ()=0
Get current stencil bits.
virtual bool IsStereoEnabled () const =0
Returns true if stereo rendering is enabled.
virtual float GetNearestRangeMax () const =0
Returns values of nearest rendering z-range max.
virtual bool ProjectToScreen (float ptx, float pty, float ptz, float *sx, float *sy, float *sz)=0
virtual int UnProject (float sx, float sy, float sz, float *px, float *py, float *pz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4])=0
Unprojects to screen.
virtual int UnProjectFromScreen (float sx, float sy, float sz, float *px, float *py, float *pz)=0
Unprojects from screen.
virtual bool WriteDDS (byte *dat, int wdt, int hgt, int Size, const char *name, ETEX_Format eF, int NumMips)=0
virtual bool WriteTGA (byte *dat, int wdt, int hgt, const char *name, int src_bits_per_pixel, int dest_bits_per_pixel)=0
virtual bool WriteJPG (byte *dat, int wdt, int hgt, char *name, int src_bits_per_pixel, int nQuality=100)=0
virtual bool FontUploadTexture (class CFBitmap *, ETEX_Format eTF=eTF_R8G8B8A8)=0
virtual int FontCreateTexture (int Width, int Height, byte *pData, ETEX_Format eTF=eTF_R8G8B8A8, bool genMips=false)=0
virtual bool FontUpdateTexture (int nTexId, int X, int Y, int USize, int VSize, byte *pData)=0
virtual void FontReleaseTexture (class CFBitmap *pBmp)=0
virtual bool FlushRTCommands (bool bWait, bool bImmediatelly, bool bForce)=0
virtual int CurThreadList ()=0
virtual void FlashRender (IFlashPlayer_RenderProxy *pPlayer, bool stereo)=0
virtual void FlashRenderPlaybackLockless (IFlashPlayer_RenderProxy *pPlayer, int cbIdx, bool stereo, bool finalPlayback)=0
virtual void FlashRemoveTexture (ITexture *pTexture)=0
virtual bool EF_PrecacheResource (SShaderItem *pSI, int iScreenTexels, float fTimeToReady, int Flags, int nUpdateId, int nCounter=1)=0
virtual bool EF_PrecacheResource (SShaderItem *pSI, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId, int nCounter=1)=0
virtual bool EF_PrecacheResource (IShader *pSH, float fMipFactor, float fTimeToReady, int Flags)=0
virtual bool EF_PrecacheResource (ITexture *pTP, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId, int nCounter=1)=0
virtual bool EF_PrecacheResource (IRenderMesh *pPB, IMaterial *pMaterial, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId)=0
virtual bool EF_PrecacheResource (SRenderLight *pLS, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId)=0
virtual void PostLevelLoading ()=0
virtual void PostLevelUnload ()=0
virtual void EF_AddMultipleParticlesToScene (const SAddParticlesToSceneJob *jobs, size_t numJobs, const SRenderingPassInfo &passInfo)=0
virtual void GetMemoryUsageParticleREs (ICrySizer *pSizer)
virtual void EF_SetShaderMissCallback (ShaderCacheMissCallback callback)=0
virtual const char * EF_GetShaderMissLogPath ()=0
virtual string * EF_GetShaderNames (int &nNumShaders)=0
virtual bool EF_ReloadFile (const char *szFileName)=0
Reloads file.
virtual bool EF_ReloadFile_Request (const char *szFileName)=0
virtual _smart_ptr< IImageFile > EF_LoadImage (const char *szFileName, uint32 nFlags)=0
virtual uint64 EF_GetRemapedShaderMaskGen (const char *name, uint64 nMaskGen=0, bool bFixup=0)=0
Remaps shader gen mask to common global mask.
virtual uint64 EF_GetShaderGlobalMaskGenFromString (const char *szShaderName, const char *szShaderGen, uint64 nMaskGen=0)=0
virtual const char * EF_GetStringFromShaderGlobalMaskGen (const char *szShaderName, uint64 nMaskGen=0)=0
virtual const SShaderProfile & GetShaderProfile (EShaderType eST) const =0
virtual void EF_SetShaderQuality (EShaderType eST, EShaderQuality eSQ)=0
virtual void EF_SubmitWind (const SWindGrid *pWind)=0
Submit window texture info.
virtual ERenderQuality EF_GetRenderQuality () const =0
Get renderer quality.
virtual EShaderQuality EF_GetShaderQuality (EShaderType eST)=0
Get shader type quality.
virtual SShaderItem EF_LoadShaderItem (const char *szName, bool bShare, int flags=0, SInputShaderResources *Res=NULL, uint64 nMaskGen=0, const SLoadShaderItemArgs *pArgs=0)=0
virtual IShader * EF_LoadShader (const char *name, int flags=0, uint64 nMaskGen=0)=0
Load shader for name (name).
virtual void EF_ReloadShaderFiles (int nCategory)=0
Reinitialize all shader files (build hash tables).
virtual void EF_ReloadTextures ()=0
Reload all texture files.
virtual ITexture * EF_GetTextureByID (int Id)=0
Get texture object by ID.
virtual ITexture * EF_GetTextureByName (const char *name, uint32 flags=0)=0
Get texture object by Name.
virtual ITexture * EF_LoadTexture (const char *nameTex, const uint32 flags=0)=0
Load the texture for name(nameTex).
virtual IDynTextureSource * EF_LoadDynTexture (const char *dynsourceName, bool sharedRT=false)=0
Load the texture for name(nameTex).
virtual int EF_LoadLightmap (const char *name)=0
Load lightmap for name.
virtual bool EF_RenderEnvironmentCubeHDR (int size, Vec3 &Pos, TArray< unsigned short > &vecData)=0
virtual bool WriteTIFToDisk (const void *pData, int width, int height, int bytesPerChannel, int numChannels, bool bFloat, const char *szPreset, const char *szFileName)=0
virtual bool StoreGBufferToAtlas (const RectI &rcDst, int nSrcWidth, int nSrcHeight, int nDstWidth, int nDstHeight, ITexture *pDataD, ITexture *pDataN)=0
Stores GBuffers region to atlas textures.
virtual CRenderElement * EF_CreateRE (EDataType edt)=0
Create new RE (RenderElement) of type (edt).
virtual void EF_StartEf (const SRenderingPassInfo &passInfo)=0
Start using of the shaders (return first index for allow recursions).
virtual CRenderObject * EF_GetObject ()=0
Get permanent RenderObject.
virtual void EF_FreeObject (CRenderObject *pObj)=0
Release permanent RenderObject.
virtual CRenderObject * EF_DuplicateRO (CRenderObject *pObj, const SRenderingPassInfo &passInfo)=0
virtual void EF_EndEf3D (const int nFlags, const int nPrecacheUpdateId, const int nNearPrecacheUpdateId, const SRenderingPassInfo &passInfo)=0
Draw all shaded REs in the list.
virtual void EF_InvokeShadowMapRenderJobs (const SRenderingPassInfo &passInfo, const int nFlags)=0
virtual IRenderView * GetNextAvailableShadowsView (IRenderView *pMainRenderView, ShadowMapFrustum *pOwnerFrustum)=0
virtual void PrepareShadowFrustumForShadowPool (ShadowMapFrustum *pFrustum, uint32 frameID, const SRenderLight &light, uint32 *timeSlicedShadowsUpdated)=0
virtual void PrepareShadowPool (CRenderView *pRenderView) const =0
virtual bool EF_IsFakeDLight (const SRenderLight *Source)=0
virtual void EF_ADDDlight (SRenderLight *Source, const SRenderingPassInfo &passInfo)=0
virtual bool EF_UpdateDLight (SRenderLight *pDL)=0
virtual bool EF_AddDeferredDecal (const SDeferredDecal &rDecal, const SRenderingPassInfo &passInfo)
virtual int EF_AddDeferredLight (const SRenderLight &pLight, float fMult, const SRenderingPassInfo &passInfo)=0
virtual void Ef_AddDeferredGIClipVolume (const IRenderMesh *pClipVolume, const Matrix34 &mxTransform)=0
virtual void EF_ReleaseDeferredData ()=0
Called in between levels to free up memory.
virtual SInputShaderResources * EF_CreateInputShaderResource (IRenderShaderResources *pOptionalCopyFrom=0)=0
Called in between levels to free up memory.
virtual void EF_SetPostEffectParam (const char *pParam, float fValue, bool bForceValue=false)=0
virtual void EF_SetPostEffectParamVec4 (const char *pParam, const Vec4 &pValue, bool bForceValue=false)=0
virtual void EF_SetPostEffectParamString (const char *pParam, const char *pszArg)=0
virtual void EF_GetPostEffectParam (const char *pParam, float &fValue)=0
virtual void EF_GetPostEffectParamVec4 (const char *pParam, Vec4 &pValue)=0
virtual void EF_GetPostEffectParamString (const char *pParam, const char *&pszArg)=0
virtual int32 EF_GetPostEffectID (const char *pPostEffectName)=0
virtual void EF_ResetPostEffects (bool bOnSpecChange=false)=0
virtual void EF_DisableTemporalEffects ()=0
virtual void EF_EndEf2D (const bool bSort)=0
void EF_Query (ERenderQueryTypes eQuery)
template
void EF_Query (ERenderQueryTypes eQuery, T &rInOut)
template
void EF_Query (ERenderQueryTypes eQuery, T0 &rInOut0, T1 &rInOut1)
virtual void ForceGC ()=0
Toggles render mesh garbage collection.
virtual int GetPolyCount ()=0
virtual void GetPolyCount (int &nPolygons, int &nShadowVolPolys)=0
virtual _smart_ptr< IRenderMesh > CreateRenderMesh (const char *szType, const char *szSourceName, IRenderMesh::SInitParamerers *pInitParams=NULL, ERenderMeshType eBufType=eRMT_Static)=0
Creates/deletes RenderMesh object.
virtual _smart_ptr< IRenderMesh > CreateRenderMeshInitialized (const void *pVertBuffer, int nVertCount, InputLayoutHandle eVF, const vtx_idx *pIndices, int nIndices, const PublicRenderPrimitiveType nPrimetiveType, const char *szType, const char *szSourceName, ERenderMeshType eBufType=eRMT_Static, int nMatInfoCount=1, int nClientTextureBindID=0, bool(*PrepareBufferCallback)(IRenderMesh *, bool)=NULL, void *CustomData=NULL, bool bOnlyVideoBuffer=false, bool bPrecache=true, const SPipTangents *pTangents=NULL, bool bLockForThreadAcc=false, Vec3 *pNormals=NULL)=0
virtual int GetFrameID (bool bIncludeRecursiveCalls=true)=0
virtual void MakeMatrix (const Vec3 &pos, const Vec3 &angles, const Vec3 &scale, Matrix34 *mat)=0
virtual float ScaleCoordX (float value) const =0
virtual float ScaleCoordY (float value) const =0
virtual void ScaleCoord (float &x, float &y) const =0
virtual void PushProfileMarker (char *label)=0
virtual void PopProfileMarker (char *label)=0
virtual void RequestFlushAllPendingTextureStreamingJobs (int nFrames)
For one frame allows disabling limit of texture streaming requests.
virtual void SetTexturesStreamingGlobalMipFactor (float fFactor)
Allow dynamic adjustment texture streaming load depending on game conditions.
virtual IRenderAuxGeom * GetIRenderAuxGeom ()=0
Interface for auxiliary geometry (for debugging, editor purposes, etc.)
virtual IRenderAuxGeom * GetOrCreateIRenderAuxGeom (const CCamera *pCustomCamera=nullptr)=0
virtual void DeleteAuxGeom (IRenderAuxGeom *pRenderAuxGeom)=0
virtual void SubmitAuxGeom (IRenderAuxGeom *pRenderAuxGeom, bool merge=true)=0
virtual void UpdateAuxDefaultCamera (const CCamera &systemCamera)=0
virtual ISvoRenderer * GetISvoRenderer ()
Interface for renderer side SVO.
virtual IColorGradingController * GetIColorGradingController ()=0
virtual IStereoRenderer * GetIStereoRenderer ()=0
virtual void Graph (byte *g, int x, int y, int wdt, int hgt, int nC, int type, char *text, ColorF &color, float fScale)=0
virtual void EnableVSync (bool enable)=0
virtual unsigned int UploadToVideoMemory (unsigned char *data, int w, int h, ETEX_Format eTFSrc, ETEX_Format eTFDst, int nummipmap, bool repeat=true, int filter=FILTER_BILINEAR, int Id=0, const char *szCacheName=NULL, int flags=0, EEndian eEndian=eLittleEndian, RectI *pRegion=NULL, bool bAsynDevTexCreation=false)=0
virtual unsigned int UploadToVideoMemory3D (unsigned char *data, int w, int h, int d, ETEX_Format eTFSrc, ETEX_Format eTFDst, int nummipmap, bool repeat=true, int filter=FILTER_BILINEAR, int Id=0, const char *szCacheName=NULL, int flags=0, EEndian eEndian=eLittleEndian, RectI *pRegion=NULL, bool bAsynDevTexCreation=false)=0
virtual unsigned int UploadToVideoMemoryCube (unsigned char *data, int w, int h, ETEX_Format eTFSrc, ETEX_Format eTFDst, int nummipmap, bool repeat=true, int filter=FILTER_BILINEAR, int Id=0, const char *szCacheName=NULL, int flags=0, EEndian eEndian=eLittleEndian, RectI *pRegion=NULL, bool bAsynDevTexCreation=false)=0
virtual void UpdateTextureInVideoMemory (uint32 tnum, unsigned char *newdata, int posx, int posy, int w, int h, ETEX_Format eTFSrc=eTF_B8G8R8, int posz=0, int sizez=1)=0
virtual bool DXTCompress (byte *raw_data, int nWidth, int nHeight, ETEX_Format eTF, bool bUseHW, bool bGenMips, int nSrcBytesPerPix, MIPDXTcallback callback)=0
virtual bool DXTDecompress (byte *srcData, const size_t srcFileSize, byte *dstData, int nWidth, int nHeight, int nMips, ETEX_Format eSrcTF, bool bUseHW, int nDstBytesPerPix)=0
virtual void RemoveTexture (unsigned int TextureId)=0
virtual bool BakeMesh (const SMeshBakingInputParams *pInputParams, SMeshBakingOutput *pReturnValues)=0
virtual bool CaptureFrameBufferFast (unsigned char *pDstRGBA8, int destinationWidth, int destinationHeight)=0
virtual bool CopyFrameBufferFast (unsigned char *pDstRGBA8, int destinationWidth, int destinationHeight)=0
virtual bool RegisterCaptureFrame (ICaptureFrameListener *pCapture)=0
virtual bool UnRegisterCaptureFrame (ICaptureFrameListener *pCapture)=0
virtual bool InitCaptureFrameBufferFast (uint32 bufferWidth=0, uint32 bufferHeight=0)=0
virtual void CloseCaptureFrameBufferFast (void)=0
This routine releases the 2 surfaces used for frame capture by the CaptureFrameBufferFast routine.
virtual void CaptureFrameBufferCallBack (void)=0
This routine checks for any frame buffer callbacks that are needed and calls them.
virtual bool ScreenShot (const char *filename=nullptr, CryDisplayContextHandle displayContext=0)=0
virtual bool ReadFrameBuffer (uint32 *pDstRGBA8, int destinationWidth, int destinationHeight)=0
Copy frame buffer into destination memory buffer.
virtual gpu_pfx2::IManager * GetGpuParticleManager ()=0
virtual void RegisterSyncWithMainListener (ISyncMainWithRenderListener *pListener)=0
virtual void RemoveSyncWithMainListener (const ISyncMainWithRenderListener *pListener)=0
virtual void Set2DMode (bool enable, int ortox, int ortoy, float znear=-1e10f, float zfar=1e10f)=0
virtual void EnableSwapBuffers (bool bEnable)=0
virtual bool StopRendererAtFrameEnd (uint timeoutMilliseconds)=0
virtual void ResumeRendererFromFrameEnd ()=0
Resume renderer that was stopped at the end of the frame with StopRendererAtFrameEnd().
virtual WIN_HWND GetHWND ()=0
virtual bool SetWindowIcon (const char *path)=0
virtual void OnEntityDeleted (struct IRenderNode *pRenderNode)=0
virtual int CreateRenderTarget (int nWidth, int nHeight, const ColorF &cClear, ETEX_Format eTF)=0
virtual bool DestroyRenderTarget (int nHandle)=0
virtual float EF_GetWaterZElevation (float fX, float fY)=0
virtual IOpticsElementBase * CreateOptics (EFlareType type) const =0
virtual void PauseTimer (bool bPause)=0
virtual IShaderPublicParams * CreateShaderPublicParams ()=0
virtual void SetLevelLoadingThreadId (threadID threadId)=0
virtual void GetThreadIDs (threadID &mainThreadID, threadID &renderThreadID) const =0
virtual IScaleformPlayback * SF_CreatePlayback () const =0
virtual int SF_CreateTexture (int width, int height, int numMips, const unsigned char *pData, ETEX_Format eTF, int flags)=0
virtual bool SF_UpdateTexture (int texId, int mipLevel, int numRects, const SUpdateRect *pRects, const unsigned char *pData, size_t pitch, size_t size, ETEX_Format eTF)=0
virtual bool SF_ClearTexture (int texId, int mipLevel, int numRects, const SUpdateRect *pRects, const unsigned char *pData)=0
virtual void SF_Playback (IScaleformPlayback *pRenderer, GRendererCommandBufferReadOnly *pBuffer) const =0
virtual void SF_Drain (GRendererCommandBufferReadOnly *pBuffer) const =0
virtual void SF_GetMeshMaxSize (int &numVertices, int &numIndices) const =0
virtual ITexture * CreateTexture (const char *name, int width, int height, int numMips, unsigned char *pData, ETEX_Format eTF, int flags)=0
virtual ITexture * CreateTextureArray (const char *name, ETEX_Type eType, uint32 nWidth, uint32 nHeight, uint32 nArraySize, int nMips, uint32 nFlags, ETEX_Format eTF, int nCustomID)=0
virtual const RPProfilerStats * GetRPPStats (ERenderPipelineProfilerStats eStat, bool bCalledFromMainThread=true)=0
virtual const RPProfilerStats * GetRPPStatsArray (bool bCalledFromMainThread=true)=0
virtual int GetPolygonCountByType (uint32 EFSList, EVertexCostTypes vct, uint32 z, bool bCalledFromMainThread=true)=0
virtual void StartLoadtimeFlashPlayback (ILoadtimeCallback *pCallback)=0
virtual void StopLoadtimeFlashPlayback ()=0
virtual void SetCloudShadowsParams (int nTexID, const Vec3 &speed, float tiling, bool invert, float brightness)=0
virtual void SetVolumetricCloudParams (int nTexID)=0
virtual void SetVolumetricCloudNoiseTex (int cloudNoiseTexId, int edgeNoiseTexId)=0
virtual int GetMaxTextureSize ()=0
virtual const char * GetTextureFormatName (ETEX_Format eTF)=0
virtual int GetTextureFormatDataSize (int nWidth, int nHeight, int nDepth, int nMips, ETEX_Format eTF)=0
virtual bool IsTextureFormatSupported (ETEX_Format eTF)=0
virtual void SetDefaultMaterials (IMaterial *pDefMat, IMaterial *pTerrainDefMat)=0
virtual uint32 GetActiveGPUCount () const =0
virtual ShadowFrustumMGPUCache * GetShadowFrustumMGPUCache ()=0
virtual const StaticArray< int, MAX_GSM_LODS_NUM > & GetCachedShadowsResolution () const =0
virtual void SetCachedShadowsResolution (const StaticArray< int, MAX_GSM_LODS_NUM > &arrResolutions)=0
virtual void UpdateCachedShadowsLodCount (int nGsmLods) const =0
virtual void SetTexturePrecaching (bool stat)=0
virtual void RT_InsertGpuCallback (uint32 context, GpuCallbackFunc callback)=0
Platform-specific.
virtual void EnablePipelineProfiler (bool bEnable)=0
virtual void QueryActiveGpuInfo (SGpuInfo &info) const =0
virtual void GetRenderTimes (SRenderTimes &outTimes)=0
virtual float GetGPUFrameTime ()=0
virtual void EnableBatchMode (bool enable)=0
Enable the batch mode if the meshpools are used to enable quick and dirty flushes.
virtual void EnableLevelUnloading (bool enable)=0
Flag level unloading in progress to disable f.i. rendermesh creation requests.
virtual RNDrawcallsMapMesh & GetDrawCallsInfoPerMesh (bool mainThread=true)=0
Get draw call info for frame.
virtual int GetDrawCallsPerNode (IRenderNode *pRenderNode)=0
virtual void ForceRemoveNodeFromDrawCallsMap (IRenderNode *pNode)=0
virtual void CollectDrawCallsInfo (bool status)=0
virtual void CollectDrawCallsInfoPerNode (bool status)=0
virtual SSkinningData * EF_CreateSkinningData (IRenderView *pRenderView, uint32 nNumBones, bool bNeedJobSyncVar)=0
virtual SSkinningData * EF_CreateRemappedSkinningData (IRenderView *pRenderView, uint32 nNumBones, SSkinningData *pSourceSkinningData, uint32 nCustomDataSize, uint32 pairGuid)=0
virtual void EF_EnqueueComputeSkinningData (IRenderView *pRenderView, SSkinningData *pData)=0
virtual int EF_GetSkinningPoolID ()=0
virtual void UpdateShaderItem (SShaderItem *pShaderItem, IMaterial *pMaterial)=0
virtual void ForceUpdateShaderItem (SShaderItem *pShaderItem, IMaterial *pMaterial)=0
virtual void RefreshShaderResourceConstants (SShaderItem *pShaderItem, IMaterial *pMaterial)=0
virtual void SetHighlightColor (ColorF color)=0
Used for editor highlights, sets the highlight color.
virtual void SetSelectionColor (ColorF color)=0
Used for editor highlights, sets the selection color.
virtual void SetHighlightParams (float outlineThickness, float fGhostAlpha)=0
Used for editor highlights, sets outline thickness and ghost alpha parameters for the effect.
virtual bool IsStereoModeChangePending ()=0
Determine if a switch to stereo mode will occur at the start of the next frame.
virtual void SyncComputeVerticesJobs ()=0
Wait for all particle ComputeVertices jobs to finish.
virtual void LockParticleVideoMemory ()=0
Lock/Unlock the video memory buffer used by particles when using the jobsystem.
virtual void UnLockParticleVideoMemory ()=0
virtual void ActivateLayer (const char *pLayerName, bool activate)=0
virtual void FlushPendingTextureTasks ()=0
virtual void FlushPendingUploads ()=0
virtual void SetCloakParams (const SRendererCloakParams &cloakParams)=0
virtual float GetCloakFadeLightScale () const =0
virtual void SetCloakFadeLightScale (float fColorScale)=0
virtual void SetShadowJittering (float fShadowJittering)=0
virtual float GetShadowJittering () const =0
virtual bool LoadShaderStartupCache ()=0
virtual void UnloadShaderStartupCache ()=0
virtual void CopyTextureRegion (ITexture *pSrc, RectI srcRegion, ITexture *pDst, RectI dstRegion, ColorF &color, const int renderStateFlags)=0
Copy a region from source texture to destination texture and apply a tint color. If blend is false, the source will override the destination area. Otherwise it will perform an alpha blend.
virtual bool LoadShaderLevelCache ()=0
virtual void UnloadShaderLevelCache ()=0
virtual void SetRendererCVar (ICVar *pCVar, const char *pArgText, const bool bSilentMode=false)=0
virtual IGraphicsDeviceConstantBufferPtr CreateGraphiceDeviceConstantBuffer ()=0

Detailed Description

Main interface to the renderer implementation, wrapping the low-level graphics API.

Member Function Documentation

◆ CaptureFrameBufferFast()

virtual bool IRenderer::CaptureFrameBufferFast ( unsigned char * pDstRGBA8,
int destinationWidth,
int destinationHeight
)
pure virtual

This routines uses 2 destination surfaces. It triggers a backbuffer copy to one of its surfaces, and then copies the other surface to system memory. This hopefully will remove any CPU stalls due to the rect lock call since the buffer will already be in system memory when it is called.

Parameters
pDstARGBA8Pointer to a buffer that will hold the captured frame (should be at least 4*dstWidth*dstHieght for RGBA surface).
destinationWidthWidth of the frame to copy.
destinationHeightHeight of the frame to copy.
Note
If dstWidth or dstHeight is larger than the current surface dimensions, the dimensions of the surface are used for the copy.

◆ CopyFrameBufferFast()

virtual bool IRenderer::CopyFrameBufferFast ( unsigned char * pDstRGBA8,
int destinationWidth,
int destinationHeight
)
pure virtual

Copy a captured surface to a buffer.

Parameters
pDstARGBA8Pointer to a buffer that will hold the captured frame (should be at least 4*dstWidth*dstHieght for RGBA surface).
destinationWidthWidth of the frame to copy.
destinationHeightHeight of the frame to copy.
Note
If dstWidth or dstHeight is larger than the current surface dimensions, the dimensions of the surface are used for the copy.

◆ CreateShaderPublicParams()

virtual IShaderPublicParams* IRenderer::CreateShaderPublicParams ( )
pure virtual

Creates an Interface to the public params container.

Returns
Created IShaderPublicParams interface.

◆ EF_Query()

void IRenderer::EF_Query ( ERenderQueryTypes eQuery)
inline

Returns various Renderer Settings, see ERenderQueryTypes.

Parameters
Querye.g. EFQ_GetShaderCombinations.
rInOutInput/Output Parameter, depends on the query if written to/read from, or both.

◆ EF_ReloadFile_Request()

virtual bool IRenderer::EF_ReloadFile_Request ( const char * szFileName)
pure virtual

Reloads file at any time the renderer feels to do so (no guarantees, but likely on next frame update).

Note
This function is is thread safe.

◆ EnumDisplayFormats()

virtual int IRenderer::EnumDisplayFormats ( SDispFormat * Formats)
pure virtual

Creates array of all supported video formats (except low resolution formats).

Returns
Number of formats in memory.

◆ GetCurrentNumberOfDrawCalls()

virtual int IRenderer::GetCurrentNumberOfDrawCalls ( const uint32 EFSListMask)
pure virtual

Sums DIP counts for the EFSLIST_* passes that match the submitted mask. Compose the mask with bitwise arithmetic, use (1 << EFSLIST_*) per list. E.g. to sum general and transparent, pass in ( (1 << EFSLIST_GENERAL) | (1 << EFSLIST_TRANSP) ).

◆ GetPolyCount()

virtual int IRenderer::GetPolyCount ( )
pure virtual
Note
For stats.

◆ InitCaptureFrameBufferFast()

virtual bool IRenderer::InitCaptureFrameBufferFast ( uint32 bufferWidth = 0,
uint32 bufferHeight = 0
)
pure virtual

This routine initializes 2 destination surfaces for use by the CaptureFrameBufferFast routine. It also captures the current backbuffer into one of the created surfaces.

Parameters
bufferWidthWidth of capture buffer, on consoles the scaling is done on the GPU. Pass in 0 (the default) to use backbuffer dimensions.
bufferHeightHeight of capture buffer.
Returns
true if surfaces were created otherwise returns false.

◆ PauseTimer()

virtual void IRenderer::PauseTimer ( bool bPause)
pure virtual

Used for pausing timer related stuff. Example: For texture animations, and shader 'time' parameter.

◆ PinOcclusionBuffer()

virtual float* IRenderer::PinOcclusionBuffer ( Matrix44A & camera)
pure virtual

Pins an occlusion buffer into CPU memory, from where it can be used until UnpinOcclusionBuffer is called. The occlusion buffer is of type 'float[CULL_SIZEX * CULL_SIZEY]', and contains non-linearized depth values from 0 (near) to 1 (far). While at least one client has a buffer pinned, all other clients are guaranteed to pin the same buffer. Note: This implies all pins have to be released at some point or all clients will forever be stuck with old data. (Un)pinning can be arbitrarily nested from any thread and will never block forward progress of the render thread or GPU. The function may fail (by returning nullptr) if no data is available, in which case you must not call UnpinOcclusionBuffer.

◆ ProjectToScreen()

virtual bool IRenderer::ProjectToScreen ( float ptx,
float pty,
float ptz,
float * sx,
float * sy,
float * sz
)
pure virtual

Projects to screen. Returns true if successful.

◆ RegisterCaptureFrame()

virtual bool IRenderer::RegisterCaptureFrame ( ICaptureFrameListener * pCapture)
pure virtual

This routine registers a callback address that is called when a new frame is available.

Parameters
pCaptureAddress of the ICaptureFrameListener object.
Returns
true if successful, otherwise false.

◆ RenderDebug()

virtual void IRenderer::RenderDebug ( bool bRenderStats = true)
pure virtual
See also
r_ShowDynTextures

◆ ScreenShot()

virtual bool IRenderer::ScreenShot ( const char * filename = nullptr,
CryDisplayContextHandle displayContext = 0
)
pure virtual

Take a screenshot and save it to a file

Returns
true on success

◆ SetWindowIcon()

virtual bool IRenderer::SetWindowIcon ( const char * path)
pure virtual

Set the window icon to be displayed on the output window. The parameter is the path to a DDS texture file to be used as the icon. For best results, pass a square power-of-two sized texture, with a mip-chain.

◆ StopRendererAtFrameEnd()

virtual bool IRenderer::StopRendererAtFrameEnd ( uint timeoutMilliseconds)
pure virtual

Stop renderer at the end of the frame. E.g. ensures the renderer is not holding a lock when crash handler is trying to take a screenshot.

◆ UnRegisterCaptureFrame()

virtual bool IRenderer::UnRegisterCaptureFrame ( ICaptureFrameListener * pCapture)
pure virtual

This routine unregisters a callback address that was previously registered.

Parameters
pCaptureAddress of the ICaptureFrameListener object to unregister.
Returns
true if successful, otherwise false.