struct IRenderer { struct SLoadShaderItemArgs { IMaterial* m_pMtlSrc; IMaterial* m_pMtlSrcParent; }; struct SUpdateRect { int dstX, dstY; int srcX, srcY; int width, height; }; enum ESFMaskOp { BeginSubmitMask_Clear, BeginSubmitMask_Inc, BeginSubmitMask_Dec, EndSubmitMask, DisableMask }; struct SArtProfileData { enum EArtProfileUnit { eArtProfileUnit_GPU = 0, eArtProfileUnit_CPU, eArtProfile_NumUnits }; enum EArtProfileSections { eArtProfile_Shadows = 0, eArtProfile_ZPass, eArtProfile_Decals, eArtProfile_Lighting, eArtProfile_Opaque, eArtProfile_Transparent, eArtProfile_Max }; float times[eArtProfile_Max]; float budgets[eArtProfile_Max]; float total, budgetTotal; enum EBreakdownDetailValues { eArtProfileDetail_LightsAmbient, eArtProfileDetail_LightsCubemaps, eArtProfileDetail_LightsDeferred, eArtProfileDetail_LightsShadowMaps, eArtProfileDetail_Reflections, eArtProfileDetail_Caustics, eArtProfileDetail_RefractionOverhead, eArtProfileDetail_Rain, eArtProfileDetail_LensOptics, eArtProfileDetail_Max }; float breakdowns[eArtProfileDetail_Max]; int batches, drawcalls, processedLights; }; struct SRenderTimes { float fWaitForMain; float fWaitForRender; float fWaitForGPU; float fTimeProcessedRT; float fTimeProcessedRTScene; float fTimeProcessedGPU; float fTimeGPUIdlePercent; }; struct SDrawCallCountInfo { const uint32 MESH_NAME_LENGTH = 32; const uint32 TYPE_NAME_LENGTH = 16; Vec3 pPos; uint8 nZpass, nShadows, nGeneral, nTransparent, nMisc; char meshName[MESH_NAME_LENGTH]; char typeName[TYPE_NAME_LENGTH]; }; };
IRenderer.h
enum ESFMaskOp { BeginSubmitMask_Clear, BeginSubmitMask_Inc, BeginSubmitMask_Dec, EndSubmitMask, DisableMask };
IRenderer.h
struct SArtProfileData { enum EArtProfileUnit { eArtProfileUnit_GPU = 0, eArtProfileUnit_CPU, eArtProfile_NumUnits }; enum EArtProfileSections { eArtProfile_Shadows = 0, eArtProfile_ZPass, eArtProfile_Decals, eArtProfile_Lighting, eArtProfile_Opaque, eArtProfile_Transparent, eArtProfile_Max }; float times[eArtProfile_Max]; float budgets[eArtProfile_Max]; float total, budgetTotal; enum EBreakdownDetailValues { eArtProfileDetail_LightsAmbient, eArtProfileDetail_LightsCubemaps, eArtProfileDetail_LightsDeferred, eArtProfileDetail_LightsShadowMaps, eArtProfileDetail_Reflections, eArtProfileDetail_Caustics, eArtProfileDetail_RefractionOverhead, eArtProfileDetail_Rain, eArtProfileDetail_LensOptics, eArtProfileDetail_Max }; float breakdowns[eArtProfileDetail_Max]; int batches, drawcalls, processedLights; };
IRenderer.h
Members |
Description |
eArtProfileDetail_LightsAmbient |
Lighting |
eArtProfileDetail_LightsShadowMaps |
just the cost of the shadow maps |
eArtProfileDetail_Reflections |
Transparent |
eArtProfileDetail_RefractionOverhead |
partial resolves |
ifndef EXCLUDE_SCALEFORM_SDK
enum EArtProfileSections { eArtProfile_Shadows = 0, eArtProfile_ZPass, eArtProfile_Decals, eArtProfile_Lighting, eArtProfile_Opaque, eArtProfile_Transparent, eArtProfile_Max };
IRenderer.h
enum EArtProfileUnit { eArtProfileUnit_GPU = 0, eArtProfileUnit_CPU, eArtProfile_NumUnits };
IRenderer.h
enum EBreakdownDetailValues { eArtProfileDetail_LightsAmbient, eArtProfileDetail_LightsCubemaps, eArtProfileDetail_LightsDeferred, eArtProfileDetail_LightsShadowMaps, eArtProfileDetail_Reflections, eArtProfileDetail_Caustics, eArtProfileDetail_RefractionOverhead, eArtProfileDetail_Rain, eArtProfileDetail_LensOptics, eArtProfileDetail_Max };
IRenderer.h
Members |
Description |
eArtProfileDetail_LightsAmbient |
Lighting |
eArtProfileDetail_LightsShadowMaps |
just the cost of the shadow maps |
eArtProfileDetail_Reflections |
Transparent |
eArtProfileDetail_RefractionOverhead |
partial resolves |
detailed values for anything that is grouped together and can be timed
struct SDrawCallCountInfo { const uint32 MESH_NAME_LENGTH = 32; const uint32 TYPE_NAME_LENGTH = 16; Vec3 pPos; uint8 nZpass, nShadows, nGeneral, nTransparent, nMisc; char meshName[MESH_NAME_LENGTH]; char typeName[TYPE_NAME_LENGTH]; };
IRenderer.h
const uint32 MESH_NAME_LENGTH = 32;
char meshName[MESH_NAME_LENGTH];
uint8 nGeneral;
uint8 nMisc;
uint8 nShadows;
uint8 nTransparent;
uint8 nZpass;
Vec3 pPos;
const uint32 TYPE_NAME_LENGTH = 16;
char typeName[TYPE_NAME_LENGTH];
SDrawCallCountInfo();
void Update(CRenderObject * pObj, IRenderMesh * pRM);
Loads shader item for name (name).
struct SLoadShaderItemArgs { IMaterial* m_pMtlSrc; IMaterial* m_pMtlSrcParent; };
IRenderer.h
IMaterial* m_pMtlSrc;
IMaterial* m_pMtlSrcParent;
SLoadShaderItemArgs(IMaterial* pMtlSrc, IMaterial* pMtlSrcParent);
struct SRenderTimes { float fWaitForMain; float fWaitForRender; float fWaitForGPU; float fTimeProcessedRT; float fTimeProcessedRTScene; float fTimeProcessedGPU; float fTimeGPUIdlePercent; };
IRenderer.h
Members |
Description |
float fTimeProcessedRTScene; |
The part of the render thread between the "SCENE" profiler labels |
IRenderer.h
int dstX;
int dstY;
int height;
int srcX;
int srcY;
int width;
void Set(int dx, int dy, int sx, int sy, int w, int h);
virtual ~IRenderer();
virtual void ActivateLayer(const char* pLayerName, bool activate) = 0;
virtual void AddListener(IRendererEventListener * pRendererEventListener) = 0;
virtual void AllowGPUTimers2(bool bAllow) = 0;
virtual bool BakeMesh(const SMeshBakingInputParams * pInputParams, SMeshBakingOutput * pReturnValues) = 0;
virtual void BeginFrame() = 0;
Should be called at the beginning of every frame.
tell the renderer that we will begin/stop spawning jobs which generate SRendItems
virtual void BeginSpawningGeneratingRendItemJobs(int nThreadID) = 0;
virtual void BeginSpawningShadowGeneratingRendItemJobs(int nThreadID) = 0;
Builds terrain sector texture.
virtual void BuildTerrainTexture();
virtual void CaptureFrameBufferCallBack() = 0;
Parameters |
Description |
Outputs |
None |
This routine checks for any frame buffer callbacks that are needed and calls them
virtual bool CaptureFrameBufferFast(unsigned char * pDstRGBA8, int destinationWidth, int destinationHeight) = 0;
Parameters |
Description |
int destinationWidth |
Width of the frame to copy |
int destinationHeight |
Height of the frame to copy |
pDstARGBA8 |
Pointer to a buffer that will hold the captured frame (should be at least 4*dstWidth*dstHieght for RGBA surface) |
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
If dstWidth or dstHeight is larger than the current surface dimensions, the dimensions of the surface are used for the copy
Changes display size.
virtual bool ChangeDisplay(unsigned int width, unsigned int height, unsigned int cbpp) = 0;
Changes resolution of the window/device (doesn't require to reload the level.
virtual bool ChangeResolution(int nNewWidth, int nNewHeight, int nNewColDepth, int nNewRefreshHZ, bool bFullScreen, bool bForceReset) = 0;
Changes viewport size.
virtual void ChangeViewport(unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool bMainViewport = false) = 0;
virtual void ClearBuffer(uint32 nFlags, ColorF * vColor, float depth = 1.0f) = 0;
virtual void CloseCaptureFrameBufferFast() = 0;
None
This routine releases the 2 surfaces used for frame capture by the CaptureFrameBufferFast routine
virtual void CollectDrawCallsInfo(bool status) = 0;
virtual bool CopyFrameBufferFast(unsigned char * pDstRGBA8, int destinationWidth, int destinationHeight) = 0;
Parameters |
Description |
int destinationWidth |
Width of the frame to copy |
int destinationHeight |
Height of the frame to copy |
pDstARGBA8 |
Pointer to a buffer that will hold the captured frame (should be at least 4*dstWidth*dstHieght for RGBA surface) |
Copy a captured surface to a buffer
If dstWidth or dstHeight is larger than the current surface dimensions, the dimensions of the surface are used for the copy
virtual bool CreateContext(WIN_HWND hWnd, bool bAllowMSAA = false) = 0;
virtual IOpticsElementBase* CreateOptics(EFlareType type) const = 0;
Creates/deletes RenderMesh object.
virtual _smart_ptrCreateRenderMesh(const char * szType, const char * szSourceName, IRenderMesh::SInitParamerers * pInitParams = NULL, ERenderMeshType eBufType = eRMT_Static) = 0;
virtual _smart_ptrCreateRenderMeshInitialized(const void * pVertBuffer, int nVertCount, EVertexFormat 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 CreateRenderTarget(int nWidth, int nHeight, ETEX_Format eTF) = 0;
virtual void CreateResourceAsync(SResourceAsync* Resource) = 0;
virtual IShaderPublicParams* CreateShaderPublicParams() = 0;
Creates an Interface to the public params container. Return: Created IShaderPublicParams interface.
virtual bool DeleteContext(WIN_HWND hWnd) = 0;
virtual bool DestroyRenderTarget(int nHandle) = 0;
virtual unsigned int DownLoadToVideoMemory(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;
Draws a 2d image on the screen.
virtual void Draw2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1) = 0;
Hud etc.
Draws all images to the screen that were collected with Push2dImage.
virtual void Draw2dImageList() = 0;
virtual void Draw2dImageStretchMode(bool stretch) = 0;
void Draw2dLabel(float x, float y, float font_size, const ColorF & fColor, bool bCenter, const char * label_text, ...);
void Draw2dLabel(float x, float y, float font_size, const float * pfColor, bool bCenter, const char * label_text, ...);
Draws user primitives.
virtual void DrawDynVB(SVF_P3F_C4B_T2F * pBuf, uint16 * pInds, int nVerts, int nInds, const PublicRenderPrimitiveType nPrimType) = 0;
Draws a image using the current matrix.
virtual void DrawImage(float xpos, float ypos, float w, float h, int texture_id, float s0, float t0, float s1, float t1, float r, float g, float b, float a, bool filtered = true) = 0;
virtual void DrawImageWithUV(float xpos, float ypos, float z, float width, float height, int texture_id, float * s, float * t, float r = 1, float g = 1, float b = 1, float a = 1, bool filtered = true) = 0;
Draws a image using the current matrix, more flexible than DrawImage order for s and t: 0=left_top, 1=right_top, 2=right_bottom, 3=left_bottom.
Helper functions to draw text.
void DrawLabel(Vec3 pos, float font_size, const char * label_text, ...);
void DrawLabelEx(Vec3 pos, float font_size, const float * pfColor, bool bFixedSize, bool bCenter, const char * label_text, ...);
virtual void DrawStringW(IFFont_RenderProxy* pFont, float x, float y, float z, const wchar_t* pStr, const bool asciiMultiLine, const STextDrawContext& ctx) const = 0;
virtual void DrawTextQueued(Vec3 pos, SDrawTextInfo & ti, const char * text) = 0;
Draws text queued.
Position can be in 3d or in 2d depending on the flags.
virtual void DrawTextQueued(Vec3 pos, SDrawTextInfo & ti, const char * format, va_list args) = 0;
Draws text queued.
Position can be in 3d or in 2d depending on the flags.
virtual bool DXTCompress(byte * raw_data, int nWidth, int nHeight, ETEX_Format eTF, bool bUseHW, bool bGenMips, int nSrcBytesPerPix, const Vec3 vLumWeight, MIPDXTcallback callback) = 0;
Parameters |
Description |
const Vec3 vLumWeight |
0,0,0 if default should be used. |
Without header.
virtual bool EF_AddDeferredDecal(const SDeferredDecal & rDecal);
virtual void Ef_AddDeferredGIClipVolume(const IRenderMesh * pClipVolume, const Matrix34& mxTransform) = 0;
Deferred clip volumes
virtual int EF_AddDeferredLight(const CDLight & pLight, float fMult, const SRenderingPassInfo & passInfo, const SRendItemSorter & rendItemSorter) = 0;
Deferred lights/vis areas
virtual void EF_AddDeferredVisArea(const IVisArea * pVisArea) = 0;
virtual void EF_ADDDlight(CDLight * Source, const SRenderingPassInfo & passInfo) = 0;
Adds shader to the list.
virtual void EF_AddEf(CRendElementBase * pRE, SShaderItem& pSH, CRenderObject * pObj, const SRenderingPassInfo & passInfo, int nList, int nAW, const SRendItemSorter & rendItemSorter) = 0;
virtual void EF_AddMultipleParticlesToScene(const SAddParticlesToSceneJob* jobs, size_t numJobs, const SRenderingPassInfo & passInfo) = 0;
virtual CRenderObject* EF_AddPolygonToScene(SShaderItem& si, CRenderObject* obj, const SRenderingPassInfo & passInfo, int numPts, int ninds, SVF_P3F_C4B_T2F*& verts, SPipTangents*& tangs, uint16*& inds, int nAW, const SRendItemSorter & rendItemSorter) = 0;
virtual CRenderObject* EF_AddPolygonToScene(SShaderItem& si, int numPts, const SVF_P3F_C4B_T2F * verts, const SPipTangents * tangs, CRenderObject * obj, const SRenderingPassInfo & passInfo, uint16 * inds, int ninds, int nAW, const SRendItemSorter & rendItemSorter) = 0;
virtual void EF_AddWaterSimHit(const Vec3 & vPos, const float scale, const float strength) = 0;
virtual void EF_ClearDeferredLightsList() = 0;
virtual void EF_ClearDeferredVisAreasList() = 0;
void EF_ClearLightsList();
For FC Compatibility.
virtual void EF_ClearSkinningDataPool() = 0;
virtual ITexture* EF_CreateCompositeTexture(int type, const char * szName, int nWidth, int nHeight, int nDepth, int nMips, int nFlags, ETEX_Format eTF, const STexComposition* pCompositions, size_t nCompositions, int8 nPriority = -1) = 0;
Creates new RE (RenderElement) of type (edt).
virtual CRendElementBase * EF_CreateRE(EDataType edt) = 0;
virtual SSkinningData* EF_CreateRemappedSkinningData(uint32 nNumBones, SSkinningData * pSourceSkinningData, uint32 nCustomDataSize, uint32 pairGuid) = 0;
virtual SSkinningData* EF_CreateSkinningData(uint32 nNumBones, bool bNeedJobSyncVar) = 0;
virtual void EF_DisableTemporalEffects() = 0;
virtual CRenderObject * EF_DuplicateRO(CRenderObject * pObj, const SRenderObjectModifier * pROII, const SRenderingPassInfo & passInfo) = 0;
Get permanent RenderObject
virtual void EF_EndEf2D(const bool bSort) = 0;
2d interface for the shaders
Draws all shaded REs in the list
virtual void EF_EndEf3D(const int nFlags, const int nPrecacheUpdateId, const int nNearPrecacheUpdateId, const SRenderingPassInfo & passInfo) = 0;
virtual TArray<SRenderLight>* EF_GetDeferredLights(const SRenderingPassInfo & passInfo, const eDeferredLightType eLightType = eDLT_DeferredLight) = 0;
virtual uint32 EF_GetDeferredLightsNum(const eDeferredLightType eLightType = eDLT_DeferredLight) = 0;
virtual SRenderObjData * EF_GetObjData(CRenderObject * pObj, bool bCreate, int nThreadID) = 0;
Gets CRenderObject for RE transformation. Get temporary RenderObject
virtual CRenderObject * EF_GetObject_Temp(int nThreadID) = 0;
virtual int32 EF_GetPostEffectID(const char* pPostEffectName) = 0;
virtual void EF_GetPostEffectParam(const char * pParam, float & fValue) = 0;
virtual void EF_GetPostEffectParamString(const char * pParam, const char* & pszArg) = 0;
virtual void EF_GetPostEffectParamVec4(const char * pParam, Vec4 & pValue) = 0;
Remaps shader gen mask to common global mask.
virtual uint64 EF_GetRemapedShaderMaskGen(const char * name, uint64 nMaskGen = 0, bool bFixup = 0) = 0;
Gets renderer quality.
virtual ERenderQuality EF_GetRenderQuality() const = 0;
virtual uint64 EF_GetShaderGlobalMaskGenFromString(const char * szShaderName, const char * szShaderGen, uint64 nMaskGen = 0) = 0;
virtual const char* EF_GetShaderMissLogPath() = 0;
virtual string * EF_GetShaderNames(int& nNumShaders) = 0;
Gets shader type quality.
virtual EShaderQuality EF_GetShaderQuality(EShaderType eST) = 0;
virtual int EF_GetSkinningPoolID() = 0;
virtual const char * EF_GetStringFromShaderGlobalMaskGen(const char * szShaderName, uint64 nMaskGen = 0) = 0;
Gets texture object by ID.
virtual ITexture * EF_GetTextureByID(int Id) = 0;
Gets texture object by Name.
virtual ITexture * EF_GetTextureByName(const char * name, uint32 flags = 0) = 0;
virtual uint8 EF_GetVisAreaStencilRef(const IVisArea * pVisArea, const SRenderingPassInfo & passInfo) = 0;
virtual float EF_GetWaterZElevation(float fX, float fY) = 0;
virtual void EF_InvokeShadowMapRenderJobs(const int nFlags) = 0;
virtual bool EF_IsFakeDLight(const CDLight * Source) = 0;
Loads the texture for name(nameTex).
virtual IDynTextureSource * EF_LoadDynTexture(const char* dynsourceName, bool sharedRT = false) = 0;
Loads lightmap for name.
virtual int EF_LoadLightmap(const char * name) = 0;
Loads shader for name (name).
virtual IShader * EF_LoadShader(const char * name, int flags = 0, uint64 nMaskGen = 0) = 0;
virtual SShaderItem EF_LoadShaderItem(const char * szName, bool bShare, int flags = 0, SInputShaderResources * Res = NULL, uint64 nMaskGen = 0, const SLoadShaderItemArgs* pArgs = 0) = 0;
Loads the texture for name(nameTex).
virtual ITexture * EF_LoadTexture(const char* nameTex, const uint32 flags = 0) = 0;
virtual bool EF_PrecacheResource(CDLight * pLS, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId) = 0;
virtual bool EF_PrecacheResource(IRenderMesh * pPB, IMaterial * pMaterial, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId) = 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(SShaderItem * pSI, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId, int nCounter = 1) = 0;
External interface for shaders
Returns various Renderer Settings, see ERenderQueryTypes.
void EF_Query(ERenderQueryTypes eQuery);
Parameters |
Description |
Query |
e.g. EFQ_GetShaderCombinations. |
rInOut |
Input/Output Parameter, depends on the query if written to/read from, or both |
template <typename T> void EF_Query(ERenderQueryTypes eQuery, T & rInOut);
template <typename T0, typename T1> void EF_Query(ERenderQueryTypes eQuery, T0 & rInOut0, T1 & rInOut1);
virtual void EF_ReleaseDeferredData() = 0;
called in between levels to free up memory
virtual void EF_ReleaseInputShaderResource(SInputShaderResources * pRes) = 0;
called in between levels to free up memory
Reloads file
virtual bool EF_ReloadFile(const char * szFileName) = 0;
Reloads file at any time the renderer feels to do so (no guarantees, but likely on next frame update) Is threadsafe
virtual bool EF_ReloadFile_Request(const char * szFileName) = 0;
Reinitializes all shader files (build hash tables).
virtual void EF_ReloadShaderFiles(int nCategory) = 0;
Reloads all texture files.
virtual void EF_ReloadTextures() = 0;
virtual bool EF_RenderEnvironmentCubeHDR(int size, Vec3& Pos, TArray<unsigned short>& vecData) = 0;
virtual void EF_ResetPostEffects(bool bOnSpecChange = false) = 0;
virtual void EF_SetPostEffectParam(const char * pParam, float fValue, bool bForceValue = false) = 0;
Post processing effects interfaces
virtual void EF_SetPostEffectParamString(const char * pParam, const char * pszArg) = 0;
virtual void EF_SetPostEffectParamVec4(const char * pParam, const Vec4 & pValue, bool bForceValue = false) = 0;
virtual void EF_SetShaderMissCallback(ShaderCacheMissCallback callback) = 0;
Shaders/Shaders management
virtual void EF_SetShaderQuality(EShaderType eST, EShaderQuality eSQ) = 0;
Starts using of the shaders (return first index for allow recursions).
virtual void EF_StartEf(const SRenderingPassInfo & passInfo) = 0;
virtual bool EF_UpdateDLight(SRenderLight * pDL) = 0;
virtual void EnableBatchMode(bool enable) = 0;
Enable the batch mode if the meshpools are used to enable quick and dirty flushes.
virtual bool EnableFog(bool enable) = 0;
virtual void EnableGPUTimers2(bool bEnabled) = 0;
virtual void EnableLevelUnloading(bool enable) = 0;
Flag level unloading in progress to disable f.i. rendermesh creation requests
virtual void EnablePipelineProfiler(bool bEnable) = 0;
virtual void EnableSwapBuffers(bool bEnable) = 0;
virtual void EnableTerrainAO(const bool bEnabled) = 0;
allows to enable/disable TerrainAO on a per-level base
virtual void EnableVSync(bool enable) = 0;
The following functions will be removed.
virtual void EndFrame() = 0;
Should be called at the end of every frame.
virtual void EndSpawningGeneratingRendItemJobs(int nThreadID) = 0;
Returns all supported by video card video AA formats.
virtual int EnumAAFormats(SAAFormat * Formats) = 0;
virtual int EnumDisplayFormats(SDispFormat * Formats) = 0;
Number of formats in memory.
Creates array of all supported video formats (except low resolution formats).
virtual void ExecuteAsyncDIP() = 0;
virtual void FillArtProfileData(SArtProfileData & data, SArtProfileData::EArtProfileUnit unit) = 0;
virtual void FlushPendingTextureTasks() = 0;
virtual bool FlushRTCommands(bool bWait, bool bImmediatelly, bool bForce) = 0;
virtual void FlushTextMessages() = 0;
virtual int FontCreateTexture(int Width, int Height, byte * pData, ETEX_Format eTF = eTF_A8R8G8B8, bool genMips = false) = 0;
virtual void FontReleaseTexture(class CFBitmap * pBmp) = 0;
virtual void FontRestoreRenderingState() = 0;
virtual void FontSetBlending(int src, int dst) = 0;
virtual void FontSetRenderingState(unsigned int nVirtualScreenWidth, unsigned int nVirtualScreenHeight) = 0;
virtual void FontSetTexture(class CFBitmap*, int nFilterMode) = 0;
virtual void FontSetTexture(int nTexId, int nFilterMode) = 0;
virtual bool FontUpdateTexture(int nTexId, int X, int Y, int USize, int VSize, byte * pData) = 0;
virtual bool FontUploadTexture(class CFBitmap*, ETEX_Format eTF = eTF_A8R8G8B8) = 0;
Replacement functions for Font
Toggles render mesh garbage collection
virtual void ForceGC() = 0;
virtual void ForceSwapBuffers() = 0;
Force a swap on the backbuffer
virtual void ForceUpdateShaderItem(SShaderItem * pShaderItem, IMaterial * pMaterial) = 0;
Frees the allocated resources.
virtual void FreeResources(int nFlags) = 0;
Gets textures streaming bandwidth information
virtual void GetBandwidthStats(float * fBandwidthRequested) = 0;
Gets the renderer camera.
virtual const CCamera& GetCamera() = 0;
virtual float GetCloakFadeLightScale() const = 0;
Gets current bpp.
virtual int GetColorBpp() = 0;
virtual WIN_HWND GetCurrentContextHWND() = 0;
virtual float GetCurrentDrawCallRTTimes(const uint32 EFSListMask) = 0;
virtual int GetCurrentNumberOfDrawCalls() = 0;
virtual void GetCurrentNumberOfDrawCalls(int & nGeneral, int & nShadowGen) = 0;
virtual int GetCurrentNumberOfDrawCalls(const uint32 EFSListMask) = 0;
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) ) Please note that this doesn't subtract the global count of DIPs skipped on the PS3 due to conditional rendering 3 as it isn't per-pass information
Gets current z-buffer depth.
virtual int GetDepthBpp() = 0;
virtual int GetFeatures() = 0;
virtual JobManager::SJobState * GetFinalizeRendItemJobState(int nThreadID) = 0;
virtual JobManager::SJobState * GetFinalizeShadowRendItemJobState(int nThreadID) = 0;
virtual int GetFrameID(bool bIncludeRecursiveCalls = true) = 0;
get the shared job state for SRendItem Generating jobs
virtual JobManager::SJobState * GetGenerateRendItemJobState(int nThreadID) = 0;
virtual JobManager::SJobState * GetGenerateRendItemJobStatePreProcess(int nThreadID) = 0;
virtual JobManager::SJobState * GetGenerateShadowRendItemJobState(int nThreadID) = 0;
virtual uint32 GetGPUCount() const = 0;
virtual float GetGPUFrameTime() = 0;
Gets height of the main rendering resolution.
virtual int GetHeight() = 0;
virtual WIN_HWND GetHWND() = 0;
virtual IColorGradingController* GetIColorGradingController() = 0;
virtual bool GetImageCaps(const char* filename, int& width, int& height) const = 0;
Interface for auxiliary geometry (for debugging, editor purposes, etc.)
virtual IRenderAuxGeom* GetIRenderAuxGeom() = 0;
virtual IStereoRenderer* GetIStereoRenderer() = 0;
virtual int GetMaxTextureSize() = 0;
Gets memory status information
virtual void GetMemoryUsage(ICrySizer* Sizer) = 0;
virtual void GetMemoryUsageParticleREs(ICrySizer * pSizer);
virtual void GetModelViewMatrix(float * mat) = 0;
For editor.
virtual const MTRenderInfo& GetMTRenderInfo() const = 0;
Gets height of the potentially native resolution framebuffer used for UI and debug output.
virtual int GetNativeHeight() = 0;
Gets width of the potentially native resolution framebuffer used for UI and debug output.
virtual int GetNativeWidth() = 0;
Returns values of nearest rendering z-range max
virtual float GetNearestRangeMax() const = 0;
virtual int GetNumGeomInstanceDrawCalls() = 0;
virtual int GetNumGeomInstances() = 0;
virtual int GetOcclusionBuffer(uint16* pOutOcclBuffer, int32 nSizeX, int32 nSizeY, Matrix44* pmViewProj, Matrix44* pmCamBuffer) = 0;
Gets Pixel Aspect Ratio.
virtual float GetPixelAspectRatio() const = 0;
virtual int GetPolyCount() = 0; virtual void GetPolyCount(int & nPolygons, int & nShadowVolPolys) = 0;
For stats.
virtual int GetPolygonCountByType(uint32 EFSList, EVertexCostTypes vct, uint32 z, bool bCalledFromMainThread = true) = 0;
virtual void GetProjectionMatrix(float * mat) = 0;
For editor.
virtual void GetRenderTimes(SRenderTimes & outTimes) = 0;
virtual ERenderType GetRenderType() const = 0;
virtual const RPProfilerStats* GetRPPStats(ERenderPipelineProfilerStats eStat, bool bCalledFromMainThread = true) = 0;
virtual const RPProfilerStats* GetRPPStatsArray(bool bCalledFromMainThread = true) = 0;
virtual EScreenAspectRatio GetScreenAspect(int nWidth, int nHeight) = 0;
virtual const SShaderProfile & GetShaderProfile(EShaderType eST) const = 0;
virtual ShadowFrustumMGPUCache* GetShadowFrustumMGPUCache() = 0;
virtual float GetShadowJittering() const = 0;
Gets current stencil bits.
virtual int GetStencilBpp() = 0;
virtual int GetTextureFormatDataSize(int nWidth, int nHeight, int nDepth, int nMips, ETEX_Format eTF) = 0;
virtual const char * GetTextureFormatName(ETEX_Format eTF) = 0;
virtual void GetThreadIDs(threadID& mainThreadID, threadID& renderThreadID) const = 0;
virtual void GetVideoMemoryUsageStats(size_t& vidMemUsedThisFrame, size_t& vidMemUsedRecently, bool bGetPoolsSizes = false) = 0;
virtual void GetViewport(int * x, int * y, int * width, int * height) = 0;
Gets the white texture Id.
virtual int GetWhiteTextureId() const = 0;
Gets width of the main rendering resolution.
virtual int GetWidth() = 0;
Initializes the renderer, params are self-explanatory.
virtual WIN_HWND Init(int x, int y, int width, int height, unsigned int cbpp, int zbpp, int sbits, bool fullscreen, WIN_HINSTANCE hinst, WIN_HWND Glhwnd = 0, bool bReInit = false, const SCustomRenderInitArgs* pCustomArgs = 0, bool bShaderCacheGen = false) = 0;
virtual bool InitCaptureFrameBufferFast(uint32 bufferWidth = 0, uint32 bufferHeight = 0) = 0;
Parameters |
Description |
uint32 bufferWidth = 0 |
Width of capture buffer, on consoles the scaling is done on the GPU. Pass in 0 (the default) to use backbuffer dimensions |
uint32 bufferHeight = 0 |
Height of capture buffer. |
Outputs |
returns true if surfaces were created otherwise returns false |
This routine initializes 2 destination surfaces for use by the CaptureFrameBufferFast routine It also, captures the current backbuffer into one of the created surfaces
Creates default system shaders and textures.
virtual void InitSystemResources(int nFlags) = 0;
virtual bool IsDebugRenderNode(IRenderNode* pRenderNode) const = 0;
virtual bool IsMultiGPUModeActive() const = 0;
virtual bool IsPost3DRendererEnabled() const;
virtual bool IsRenderingIntroMovies() const = 0;
Returns true if stereo rendering is enabled.
virtual bool IsStereoEnabled() const = 0;
Determine if a switch to stereo mode will occur at the start of the next frame
virtual bool IsStereoModeChangePending() = 0;
virtual bool LoadShaderLevelCache() = 0;
virtual bool LoadShaderStartupCache() = 0;
Lock/Unlock the video memory buffer used by particles when using the jobsystem
virtual void LockParticleVideoMemory(uint32 nId) = 0;
virtual void MakeMainContextActive() = 0;
virtual void MakeMatrix(const Vec3 & pos, const Vec3 & angles, const Vec3 & scale, Matrix34* mat) = 0;
virtual bool MergeImages(const char* output_filename, int out_width, int out_height, const char** files, int* offsetsX, int* offsetsY, int* widths, int* heights, int* src_offsetsX, int* src_offsetsY, int* src_width, int* src_height, int count) const = 0;
virtual void OffsetPosition(const Vec3 & delta) = 0;
virtual void OnEntityDeleted(struct IRenderNode * pRenderNode) = 0;
virtual void PauseTimer(bool bPause) = 0;
Used for pausing timer related stuff.
For texture animations, and shader 'time' parameter.
virtual void PopMatrix() = 0;
virtual void PopProfileMarker(char* label) = 0;
virtual void PopWireframeMode() = 0;
virtual void PostInit() = 0;
virtual void PostLevelLoading() = 0;
virtual void PostLevelUnload() = 0;
virtual void ProcessVoxTerrainDebugTarget(int * pSrcTexIds, int nMipsNum, bool bOnlySetSrcTexture = true);
Projects to screen. Returns true if successful.
virtual bool ProjectToScreen(float ptx, float pty, float ptz, float * sx, float * sy, float * sz) = 0;
Adds a 2d image that should be drawn on the screen to an internal render list. The list can be drawn with Draw2dImageList. If several images will be drawn, using this function is more efficient than calling Draw2dImage as it allows better batching. The function supports placing images in stereo 3d space.
virtual void Push2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1, float stereoDepth = 0) = 0;
Parameters |
Description |
float stereoDepth = 0 |
Places image in stereo 3d space. The depth is specified in camera space, the stereo params are the same that are used for the scene. A value of 0 is handled as a special case and always places the image on the screen plane. |
virtual uint16 PushFogVolumeContribution(const ColorF& fogVolumeContrib, const SRenderingPassInfo & passInfo) = 0;
virtual void PushMatrix() = 0;
virtual void PushProfileMarker(char* label) = 0;
Sets the polygon mode with Push, Pop restores the last used one
virtual void PushWireframeMode(int mode) = 0;
Wireframe, solid.
virtual void ReadFrameBuffer(unsigned char * pRGB, int nImageX, int nSizeX, int nSizeY, ERB_Type eRBType, bool bRGBA, int nScaledX = -1, int nScaledY = -1) = 0;
virtual void ReadFrameBufferFast(uint32* pDstARGBA8, int dstWidth, int dstHeight) = 0;
virtual bool RegisterCaptureFrame(ICaptureFrameListener * pCapture) = 0;
Parameters |
Description |
ICaptureFrameListener * pCapture |
Address of the ICaptureFrameListener object |
Outputs |
returns true if successful, otherwise false |
This routine registers a callback address that is called when a new frame is available
Shuts down the renderer.
virtual void Release() = 0;
virtual void ReleaseResourceAsync(SResourceAsync* Resource) = 0;
virtual void RemoveListener(IRendererEventListener * pRendererEventListener) = 0;
virtual void RemoveTexture(unsigned int TextureId) = 0;
virtual void RenderDebug(bool bRenderStats = true) = 0;
r_ShowDynTextures
virtual void RequestFlushAllPendingTextureStreamingJobs(int nFrames);
for one frame allows to disable limit of texture streaming requests
virtual IDynTexture * RequestTerrainTexture(SBuildTerrainTextureParams & params);
virtual void ResetToDefault() = 0;
Restores gamma
virtual void RestoreGamma() = 0;
Reset gamma setting if not in fullscreen mode.
virtual int RT_CurThreadList() = 0;
virtual void RT_FlashRemoveTexture(ITexture* pTexture) = 0;
virtual void RT_FlashRender(IFlashPlayer_RenderProxy* pPlayer, bool stereo) = 0;
virtual void RT_FlashRenderPlaybackLockless(IFlashPlayer_RenderProxy* pPlayer, int cbIdx, bool stereo, bool finalPlayback) = 0;
virtual void RT_InsertGpuCallback(uint32 context, GpuCallbackFunc callback) = 0;
platform specific
Saves source data to a Tga file.
virtual bool SaveTga(unsigned char * sourcedata, int sourceformat, int w, int h, const char * filename, bool flip) const = 0;
Should not be here.
virtual void ScaleCoord(float& x, float& y) const = 0;
virtual float ScaleCoordX(float value) const = 0;
virtual float ScaleCoordY(float value) const = 0;
Gets a screenshot and save to a file
virtual bool ScreenShot(const char * filename = NULL, int width = 0) = 0;
true=success
virtual int ScreenToTexture(int nTexID) = 0;
virtual void Set2DMode(bool enable, int ortox, int ortoy, float znear = -1e10f, float zfar = 1e10f) = 0;
Sets the renderer camera.
virtual void SetCamera(const CCamera & cam) = 0;
virtual void SetClearColor(const Vec3 & vColor) = 0;
3d engine set this color to fog color.
virtual void SetCloakFadeLightScale(float fColorScale) = 0;
virtual void SetCloakParams(const SRendererCloakParams& cloakParams) = 0;
virtual void SetCloudShadowsParams(int nTexID, const Vec3& speed, float tiling, bool invert, float brightness) = 0;
virtual void SetCullMode(int mode = R_CULL_BACK) = 0;
virtual bool SetCurrentContext(WIN_HWND hWnd) = 0;
virtual void SetDebugRenderNode(IRenderNode* pRenderNode) = 0;
virtual void SetDefaultMaterials(IMaterial * pDefMat, IMaterial * pTerrainDefMat) = 0;
virtual void SetFogColor(const ColorF& color) = 0;
Sets delta gamma.
virtual bool SetGammaDelta(const float fGamma) = 0;
virtual void SetMaterialColor(float r, float g, float b, float a) = 0;
virtual void SetRendererCVar(ICVar* pCVar, const char* pArgText, const bool bSilentMode = false) = 0;
virtual bool SetRenderTarget(int nHandle, int nFlags = 0) = 0;
virtual void SetRenderTile(f32 nTilesPosX = 0.f, f32 nTilesPosY = 0.f, f32 nTilesGridSizeX = 1.f, f32 nTilesGridSizeY = 1.f) = 0;
virtual void SetScissor(int x = 0, int y = 0, int width = 0, int height = 0) = 0;
virtual void SetShadowJittering(float fShadowJittering) = 0;
Set whether or not the screen should be copied into the back buffer each frame
virtual void SetShouldCopyScreenToBackBuffer(bool bEnable) = 0;
virtual void SetState(int State, int AlphaRef = -1) = 0;
virtual void SetTerrainAONodes(PodArray<SSectorTextureSet> * terrainAONodes) = 0;
Sets the current binded texture.
virtual void SetTexture(int tnum) = 0;
virtual void SetTexturePrecaching(bool stat) = 0;
virtual void SetTexturesStreamingGlobalMipFactor(float fFactor);
allows to dynamically adjust texture streaming load depending on game conditions
Sets an event listener for texture streaming updates
virtual void SetTextureStreamListener(ITextureStreamListener* pListener) = 0;
virtual void SetViewport(int x, int y, int width, int height, int id = 0) = 0;
virtual Vec2 SetViewportDownscale(float xscale, float yscale) = 0;
Sets the white texture.
virtual void SetWhiteTexture() = 0;
virtual void SF_ConfigMask(ESFMaskOp maskOp, unsigned int stencilRef) = 0;
virtual int SF_CreateTexture(int width, int height, int numMips, unsigned char* pData, ETEX_Format eTF, int flags) = 0;
virtual void SF_DrawBlurRect(const SSF_GlobalDrawParams * pParams) = 0;
virtual void SF_DrawGlyphClear(const SSF_GlobalDrawParams& params) = 0;
virtual void SF_DrawIndexedTriList(int baseVertexIndex, int minVertexIndex, int numVertices, int startIndex, int triangleCount, const SSF_GlobalDrawParams& params) = 0;
virtual void SF_DrawLineStrip(int baseVertexIndex, int lineCount, const SSF_GlobalDrawParams& params) = 0;
virtual void SF_Flush() = 0;
virtual void SF_GetMeshMaxSize(int& numVertices, int& numIndices) const = 0;
virtual bool SF_MapTexture(int texID, int level, void*& pBits, uint32& pitch) = 0;
virtual bool SF_UnmapTexture(int texID, int level) = 0;
virtual bool SF_UpdateTexture(int texId, int mipLevel, int numRects, const SUpdateRect* pRects, unsigned char* pData, size_t pitch, ETEX_Format eTF) = 0;
Shuts down the renderer.
virtual void ShutDown(bool bReInit = false) = 0;
virtual void ShutDownFast() = 0;
virtual void StartLoadtimeFlashPlayback(ILoadtimeCallback* pCallback) = 0;
virtual void StartRenderIntroMovies() = 0;
start active rendering of the intro movies while initializing the rest of the engine
virtual void StopLoadtimeFlashPlayback() = 0;
virtual void StopRenderIntroMovies(bool bWaitForFinished) = 0;
Switches subsequent rendering from the internal backbuffer to the native resolution backbuffer if available.
virtual void SwitchToNativeResolutionBackbuffer() = 0;
Wait for all particle ComputeVertices jobs to finish
virtual void SyncComputeVerticesJobs() = 0;
virtual void TextToScreen(float x, float y, const char * format, ...);
virtual void TextToScreenColor(int x, int y, float r, float g, float b, float a, const char * format, ...);
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 void TryFlush() = 0;
virtual void UnloadShaderLevelCache() = 0;
virtual void UnloadShaderStartupCache() = 0;
virtual void UnLockParticleVideoMemory(uint32 nId) = 0;
Unprojects to screen.
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 from screen.
virtual int UnProjectFromScreen(float sx, float sy, float sz, float * px, float * py, float * pz) = 0;
virtual bool UnRegisterCaptureFrame(ICaptureFrameListener * pCapture) = 0;
Parameters |
Description |
ICaptureFrameListener * pCapture |
Address of the ICaptureFrameListener object to unregister |
Outputs |
returns true if successful, otherwise false |
This routine unregisters a callback address that was previously registered
virtual void UpdateShaderItem(SShaderItem * pShaderItem, IMaterial * pMaterial) = 0;
virtual void UpdateTextureInVideoMemory(uint32 tnum, unsigned char * newdata, int posx, int posy, int w, int h, ETEX_Format eTFSrc = eTF_R8G8B8) = 0;
virtual bool WriteDDS(byte * dat, int wdt, int hgt, int Size, const char * name, ETEX_Format eF, int NumMips) = 0;
virtual bool WriteJPG(byte * dat, int wdt, int hgt, char * name, int src_bits_per_pixel, int nQuality = 100) = 0;
virtual bool WriteTGA(byte * dat, int wdt, int hgt, const char * name, int src_bits_per_pixel, int dest_bits_per_pixel) = 0;
typedef std::map< IRenderMesh*, IRenderer::SDrawCallCountInfo > RNDrawcallsMapMesh;
Debug draw call info (per mesh)
typedef RNDrawcallsMapMesh::iterator RNDrawcallsMapMeshItor;
typedef std::map< IRenderNode*, IRenderer::SDrawCallCountInfo > RNDrawcallsMapNode;
Debug draw call info (per node)
typedef RNDrawcallsMapNode::iterator RNDrawcallsMapNodeItor;