Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -856,9 +856,6 @@ void C3DEngine::RenderWorld(const int nRenderFlags, const SRenderingPassInfo& pa
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_LW_PROFILERS
|
||||
int64 renderStart = CryGetTicks();
|
||||
#endif
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
if (GetCVars()->e_ScreenShot)
|
||||
@@ -3609,15 +3606,6 @@ void C3DEngine::SetupDistanceFog()
|
||||
{
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
// render to texture does not support volumetric fog
|
||||
if (GetRenderer()->IsRenderToTextureActive() && (GetCVars()->e_VolumetricFog != 0))
|
||||
{
|
||||
GetRenderer()->EnableFog(false);
|
||||
return;
|
||||
}
|
||||
#endif // AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
|
||||
GetRenderer()->SetFogColor(ColorF(m_vFogColor.x, m_vFogColor.y, m_vFogColor.z, 1.0f));
|
||||
GetRenderer()->EnableFog(GetCVars()->e_Fog > 0);
|
||||
}
|
||||
|
||||
@@ -1548,8 +1548,6 @@ void C3DEngine::OnExplosion(Vec3 vPos, float fRadius, [[maybe_unused]] bool bDef
|
||||
}
|
||||
|
||||
// reduce ground decals size depending on distance to the ground
|
||||
float terrainHeight = terrain->GetHeightFromFloats(vPos.x, vPos.y);
|
||||
float fExploHeight = vPos.z - terrainHeight;
|
||||
|
||||
// delete decals what can not be correctly updated
|
||||
Vec3 vRadius(fRadius, fRadius, fRadius);
|
||||
@@ -2051,7 +2049,6 @@ bool C3DEngine::SetStatInstGroup(int nGroupId, const IStatInstGroup& siGroup, in
|
||||
rGroup.bAllowIndoor = siGroup.bAllowIndoor;
|
||||
rGroup.fAlignToTerrainCoefficient = siGroup.fAlignToTerrainCoefficient;
|
||||
|
||||
bool previousAutoMerged = rGroup.bAutoMerged;
|
||||
rGroup.bAutoMerged = siGroup.bAutoMerged;
|
||||
rGroup.minConfigSpec = siGroup.minConfigSpec;
|
||||
|
||||
|
||||
@@ -552,7 +552,6 @@ namespace NAsyncCull
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Renderer);
|
||||
|
||||
int bHWZBuffer = GetCVars()->e_CoverageBufferReproj;
|
||||
int PolyLimit = GetCVars()->e_CoverageBufferRastPolyLimit;
|
||||
|
||||
if (bHWZBuffer > 3 && m_OCMBuffer.empty())
|
||||
{
|
||||
@@ -701,7 +700,6 @@ namespace NAsyncCull
|
||||
const AABB PosAABB = AABB(m_Position, 0.5f);
|
||||
const float Bias = GetCVars()->e_CoverageBufferAABBExpand;
|
||||
rMatFinalT = m_MatScreenViewProj.GetTransposed();
|
||||
bool bEnabled = m_Enabled;
|
||||
|
||||
// Debugging stats in green to screen here with how many octree nodes pass/fail and how many terrain nodes pass/fail
|
||||
unsigned int octreeNodesCulled = 0;
|
||||
|
||||
@@ -1545,8 +1545,6 @@ namespace ProcessSkinningHelpers
|
||||
vmax = i2;
|
||||
}
|
||||
}
|
||||
uint32 a = pMesh->m_subsets[m].nFirstVertId;
|
||||
uint32 b = pMesh->m_subsets[m].nNumVerts;
|
||||
if (pMesh->m_subsets[m].nFirstVertId != vmin ||
|
||||
pMesh->m_subsets[m].nNumVerts != vmax - vmin + 1)
|
||||
{
|
||||
@@ -2255,7 +2253,9 @@ bool CLoaderCGF::ProcessSkinning()
|
||||
//init internal morph-targets
|
||||
MorphTargets* pMorphtarget = pSkinningInfo->m_arrMorphTargets[it];
|
||||
uint32 numMorphVerts = pMorphtarget->m_arrIntMorph.size();
|
||||
#if !defined(NDEBUG)
|
||||
uint32 intVertexCount = pSkinningInfo->m_arrIntVertices.size();
|
||||
#endif
|
||||
for (uint32 i = 0; i < numMorphVerts; i++)
|
||||
{
|
||||
uint32 idx = pMorphtarget->m_arrIntMorph[i].nVertexId;
|
||||
@@ -3982,7 +3982,8 @@ bool CLoaderCGF::LoadFoliageInfoChunk(IChunkFile::ChunkDesc* pChunkDesc)
|
||||
|
||||
SFoliageInfoCGF& fi = *m_pCGF->GetFoliageInfo();
|
||||
bool isSkinned = m_pCGF->GetExportInfo()->bSkinnedCGF;
|
||||
if (fi.nSpines = chunk.nSpines)
|
||||
fi.nSpines = chunk.nSpines;
|
||||
if (fi.nSpines)
|
||||
{
|
||||
fi.nSkinnedVtx = chunk.nSkinnedVtx;
|
||||
|
||||
|
||||
@@ -362,7 +362,6 @@ void CSaverCGF::SaveNodes(
|
||||
for (uint i = 0; i < numNodes; i++)
|
||||
{
|
||||
CNodeCGF* pNode = m_pCGF->GetNode(i);
|
||||
const char* pNodeName = pNode->name;
|
||||
SaveNode(pNode, bSwapEndian, bStorePositionsAsF16, bUseQtangents, bStoreIndicesAsU16);
|
||||
}
|
||||
}
|
||||
@@ -459,7 +458,6 @@ int CSaverCGF::SaveNode(
|
||||
: SaveHelperChunk(pNode, bSwapEndian);
|
||||
}
|
||||
|
||||
int nextChunk = m_pChunkFile->NumChunks();
|
||||
int positionIndex = pNode->pos_cont_id;
|
||||
int rotationIndex = pNode->rot_cont_id;
|
||||
int scaleIndex = pNode->scl_cont_id;
|
||||
|
||||
@@ -43,7 +43,6 @@ void CZBufferCuller::BeginFrame(const SRenderingPassInfo& passInfo)
|
||||
m_Camera = rCam;
|
||||
m_Position = rCam.GetPosition();
|
||||
uint32 oldSizeX = m_SizeX;
|
||||
uint32 oldSizeY = m_SizeY;
|
||||
|
||||
const uint32 sizeX = min(max(1, GetCVars()->e_CoverageBufferResolution), 1024);
|
||||
const uint32 sizeY = sizeX;
|
||||
|
||||
@@ -253,8 +253,6 @@ void CDecal::Render(const float fCurTime, int nAfterWater, float fDistanceFading
|
||||
m_arrBigDecalRMCustomData[14] = vNormal.z * (m_fSize / m_fWSSize);
|
||||
m_arrBigDecalRMCustomData[15] = 0;
|
||||
|
||||
CStatObj* pBody = NULL;
|
||||
bool bUseBending = GetCVars()->e_VegetationBending != 0;
|
||||
|
||||
// draw complex decal using new indices and original object vertices
|
||||
pObj->m_fAlpha = fAlpha;
|
||||
|
||||
@@ -191,10 +191,10 @@ bool CDecalManager::SpawnHierarchical(const CryEngineDecalInfo& rootDecalInfo, C
|
||||
|
||||
for (int nEntitySlotId = 0; nEntitySlotId < 16; nEntitySlotId++)
|
||||
{
|
||||
CStatObj* _pStatObj = NULL;
|
||||
Matrix34A entSlotMatrix;
|
||||
entSlotMatrix.SetIdentity();
|
||||
if (_pStatObj = (CStatObj*)rootDecalInfo.ownerInfo.pRenderNode->GetEntityStatObj(nEntitySlotId, ~0, &entSlotMatrix, true))
|
||||
CStatObj* _pStatObj = (CStatObj*)rootDecalInfo.ownerInfo.pRenderNode->GetEntityStatObj(nEntitySlotId, ~0, &entSlotMatrix, true);
|
||||
if (_pStatObj)
|
||||
{
|
||||
if (_pStatObj->m_nFlags & STATIC_OBJECT_COMPOUND)
|
||||
{
|
||||
@@ -1014,7 +1014,9 @@ void CDecalManager::MoveToEdge(IRenderMesh* pRM, const float fRadius, Vec3& vOut
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
int nInds = pRM->GetIndicesCount();
|
||||
#endif
|
||||
|
||||
// if(nInds>6000)
|
||||
// return; // skip insane objects
|
||||
@@ -1758,8 +1760,8 @@ IStatObj* SDecalOwnerInfo::GetOwner(Matrix34A& objMat)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
IStatObj* pStatObj = NULL;
|
||||
if (pStatObj = pRenderNode->GetEntityStatObj(nRenderNodeSlotId, nRenderNodeSlotSubObjectId, &objMat, true))
|
||||
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(nRenderNodeSlotId, nRenderNodeSlotSubObjectId, &objMat, true);
|
||||
if (pStatObj)
|
||||
{
|
||||
if (nRenderNodeSlotSubObjectId >= 0 && nRenderNodeSlotSubObjectId < pStatObj->GetSubObjectCount())
|
||||
{
|
||||
|
||||
@@ -216,7 +216,8 @@ IDeferredPhysicsEvent* CDeferredPhysicsEventManager::GetLastCollisionEventForEnt
|
||||
EventPhysCollision* pLastPhysEvent;
|
||||
for (int i = m_activeDeferredEvents.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if ((pLastPhysEvent = (EventPhysCollision*)m_activeDeferredEvents[i]->PhysicsEvent()) && pLastPhysEvent->idval == EventPhysCollision::id && pLastPhysEvent->pEntity[0] == pPhysEnt)
|
||||
pLastPhysEvent = (EventPhysCollision*)m_activeDeferredEvents[i]->PhysicsEvent();
|
||||
if (pLastPhysEvent && pLastPhysEvent->idval == EventPhysCollision::id && pLastPhysEvent->pEntity[0] == pPhysEnt)
|
||||
{
|
||||
return m_activeDeferredEvents[i];
|
||||
}
|
||||
|
||||
@@ -444,13 +444,7 @@ void CFogVolumeRenderNode::Render(const SRendParams& rParam, const SRenderingPas
|
||||
m_cachedFogColor = GetFogColor();
|
||||
m_cachedSoftEdgesLerp = GetSoftEdgeLerp(viewerPosOS);
|
||||
|
||||
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
// volumetric fog is not supported in the render scene to texture pass
|
||||
bool bVolFog = (GetCVars()->e_VolumetricFog != 0) && !passInfo.IsRenderSceneToTexturePass();
|
||||
#else
|
||||
bool bVolFog = (GetCVars()->e_VolumetricFog != 0);
|
||||
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
|
||||
|
||||
// reset elapsed time for noise when FogVolume stayed out of viewport for 30 frames.
|
||||
// this prevents the time from being too large number.
|
||||
|
||||
@@ -538,7 +538,6 @@ IGeomCache::SStatistics CGeomCache::GetStatistics() const
|
||||
|
||||
std::set<uint16> materialIds;
|
||||
|
||||
CGeomCacheMeshManager& meshManager = GetGeomCacheManager()->GetMeshManager();
|
||||
|
||||
const uint numMeshes = m_staticMeshData.size();
|
||||
for (uint i = 0; i < numMeshes; ++i)
|
||||
|
||||
@@ -323,7 +323,6 @@ namespace GeomCacheDecoder
|
||||
const uint numSIMDIterations = numVertices / numVerticesPerIteration;
|
||||
|
||||
float* pPrevPositionsF = updateContext.m_prevPositions.size() > 0 ? (float*)&updateContext.m_prevPositions[0] : NULL;
|
||||
float* pStaticPositionsF = staticMeshData.m_positions.size() > 0 ? (float*)&staticMeshData.m_positions[0] : NULL;
|
||||
float* pVelocitiesF = (float*)&updateContext.m_pVelocities[0];
|
||||
__m128i* pFloorPositions128 = (__m128i*)&pFloorPositions[0];
|
||||
__m128i* pCeilPositions128 = (__m128i*)&pCeilPositions[0];
|
||||
@@ -569,7 +568,6 @@ namespace GeomCacheDecoder
|
||||
continue;
|
||||
}
|
||||
|
||||
const GeomCacheFile::SMeshFrameHeader* pFrameHeader = reinterpret_cast<GeomCacheFile::SMeshFrameHeader*>(pData);
|
||||
pData += sizeof(GeomCacheFile::SMeshFrameHeader);
|
||||
|
||||
const GeomCacheFile::EStreams streamMask = currentStaticMeshData.m_animatedStreams;
|
||||
|
||||
@@ -855,7 +855,6 @@ void CGeomCacheManager::LaunchDecompressJobs(SGeomCacheStreamInfo* pStreamInfo,
|
||||
|
||||
assert(gEnv->mMainThreadId == CryGetCurrentThreadId());
|
||||
|
||||
const CGeomCacheRenderNode* pRenderNode = pStreamInfo->m_pRenderNode;
|
||||
const CGeomCache* pGeomCache = pStreamInfo->m_pGeomCache;
|
||||
const GeomCacheFile::EBlockCompressionFormat blockCompressionFormat = pGeomCache->GetBlockCompressionFormat();
|
||||
const float currentCacheStreamingTime = pStreamInfo->m_pRenderNode->GetStreamingTime();
|
||||
@@ -1009,7 +1008,6 @@ void CGeomCacheManager::DecompressFrame_JobEntry(SGeomCacheStreamInfo* pStreamIn
|
||||
{
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
const CGeomCacheRenderNode* pRenderNode = pStreamInfo->m_pRenderNode;
|
||||
const CGeomCache* pGeomCache = pStreamInfo->m_pGeomCache;
|
||||
const uint frameIndex = pDecompressHandle->m_startFrame + blockIndex;
|
||||
|
||||
@@ -1379,7 +1377,6 @@ void CGeomCacheManager::RetireHandles(SGeomCacheStreamInfo& streamInfo)
|
||||
{
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
CGeomCacheRenderNode* pRenderNode = streamInfo.m_pRenderNode;
|
||||
const CGeomCache* pGeomCache = streamInfo.m_pGeomCache;
|
||||
const float currentCacheStreamingTime = streamInfo.m_pRenderNode->GetStreamingTime();
|
||||
const uint wantedFloorFrame = pGeomCache->GetFloorFrameIndex(currentCacheStreamingTime);
|
||||
@@ -1712,7 +1709,6 @@ void CGeomCacheManager::DrawDebugInfo()
|
||||
const float streamInfoBoxSize = 10.0f;
|
||||
|
||||
uint numActiveStreams = 0;
|
||||
uint numFramesMissed = 0;
|
||||
|
||||
const uint kNumColors = 8;
|
||||
ColorF colors[kNumColors] = { Col_Red, Col_Green, Col_Yellow, Col_Blue, Col_Aquamarine, Col_Thistle, Col_Tan, Col_Salmon };
|
||||
@@ -1725,7 +1721,6 @@ void CGeomCacheManager::DrawDebugInfo()
|
||||
CGeomCacheRenderNode* pRenderNode = streamInfo.m_pRenderNode;
|
||||
CGeomCache* pGeomCache = streamInfo.m_pGeomCache;
|
||||
const char* pName = streamInfo.m_pRenderNode->GetName();
|
||||
const char* pFilter = GetCVars()->e_GeomCacheDebugFilter->GetString();
|
||||
|
||||
const bool bDisplay = ((GetCVars()->e_GeomCacheDebug != 2) || (pRenderNode->IsStreaming() || streamInfo.m_pOldestDecompressHandle || streamInfo.m_pNewestReadRequestHandle))
|
||||
&& strstr(pName, GetCVars()->e_GeomCacheDebugFilter->GetString()) != NULL;
|
||||
|
||||
@@ -630,7 +630,6 @@ bool CGeomCacheRenderNode::FillFrameAsync(const char* const pFloorFrameData, con
|
||||
// Update meshes & clear instances
|
||||
for (uint meshId = 0; meshId < numMeshes; ++meshId)
|
||||
{
|
||||
const SGeomCacheStaticMeshData& meshData = staticMeshData[meshId];
|
||||
for (TRenderElementMap::iterator iter = m_pRenderElements.begin(); iter != m_pRenderElements.end(); ++iter)
|
||||
{
|
||||
SGeomCacheRenderElementData& data = iter->second;
|
||||
@@ -827,8 +826,6 @@ void CGeomCacheRenderNode::FillRenderObject(const SRendParams& rendParams, [[may
|
||||
{
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
IRenderNode* const pRenderNode = rendParams.pRenderNode;
|
||||
IRenderer* const pRenderer = GetRenderer();
|
||||
|
||||
pRenderObject->m_pRenderNode = rendParams.pRenderNode;
|
||||
pRenderObject->m_fSort = rendParams.fCustomSortOffset;
|
||||
@@ -1450,7 +1447,6 @@ void CGeomCacheRenderNode::UpdatePhysicalMaterials()
|
||||
|
||||
void CGeomCacheRenderNode::UpdateStreamableComponents(float fImportance, float fDistance, bool bFullUpdate, int nLod, const float fInvScale, bool bDrawNear)
|
||||
{
|
||||
IObjManager* pObjManager = GetObjManager();
|
||||
Matrix34A matrix = GetMatrix();
|
||||
|
||||
const bool bAllowStandIn = GetCVars()->e_Lods != 0;
|
||||
|
||||
@@ -483,7 +483,6 @@ bool CLightEntity::ProcessFrustum(int nLod, float fGSMBoxSize, float fDistanceFr
|
||||
assert(pFr);
|
||||
|
||||
bool bDoGSM = fGSMBoxSize != 0;
|
||||
bool bDoNextLod = false;
|
||||
|
||||
if (bDoGSM)// && (m_light.m_Flags & DLF_SUN || m_light.m_Flags & DLF_PROJECT))
|
||||
{
|
||||
@@ -555,8 +554,6 @@ void CLightEntity::InitShadowFrustum_SUN_Conserv(ShadowMapFrustum* pFr, [[maybe_
|
||||
|
||||
//Sampling parameters
|
||||
//Calculate proper projection of frustum to the terrain receiving area but not based on fBoxRadius
|
||||
float fGsmInitRange = Get3DEngine()->m_fGsmRange;
|
||||
float fGsmStep = Get3DEngine()->m_fGsmRangeStep;
|
||||
|
||||
float arrWidthS[] = {1.94f, 1.0f, 0.8f, 0.5f, 0.3f, 0.3f, 0.3f, 0.3f};
|
||||
|
||||
|
||||
@@ -874,7 +874,10 @@ static void shGetVector4(const char* buf, float v[4])
|
||||
{
|
||||
return;
|
||||
}
|
||||
int res = azsscanf(buf, "%f,%f,%f,%f", &v[0], &v[1], &v[2], &v[3]);
|
||||
#if !defined(NDEBUG)
|
||||
int res =
|
||||
#endif
|
||||
azsscanf(buf, "%f,%f,%f,%f", &v[0], &v[1], &v[2], &v[3]);
|
||||
assert(res);
|
||||
}
|
||||
|
||||
|
||||
@@ -773,8 +773,10 @@ void MaterialHelpers::SetShaderParamsFromXml(SInputShaderResources& pShaderResou
|
||||
SShaderParam Param;
|
||||
Param.m_Name = key;
|
||||
Param.m_Value.m_Color[0] = Param.m_Value.m_Color[1] = Param.m_Value.m_Color[2] = Param.m_Value.m_Color[3] = 0;
|
||||
|
||||
int res = azsscanf(val, "%f,%f,%f,%f", &Param.m_Value.m_Color[0], &Param.m_Value.m_Color[1], &Param.m_Value.m_Color[2], &Param.m_Value.m_Color[3]);
|
||||
#if !defined(NDEBUG)
|
||||
int res =
|
||||
#endif
|
||||
azsscanf(val, "%f,%f,%f,%f", &Param.m_Value.m_Color[0], &Param.m_Value.m_Color[1], &Param.m_Value.m_Color[2], &Param.m_Value.m_Color[3]);
|
||||
assert(res);
|
||||
|
||||
pShaderResources.m_ShaderParams.push_back(Param);
|
||||
|
||||
@@ -63,18 +63,54 @@ namespace mesh_compiler
|
||||
for (uint streamIndex = 0; streamIndex < CMesh::maxStreamsPerType; ++streamIndex)
|
||||
{
|
||||
SMeshTexCoord* texCoords = mesh.GetStreamPtr<SMeshTexCoord>(CMesh::TEXCOORDS, streamIndex);
|
||||
if (texCoords && (res = memcmp(&texCoords[a], &texCoords[b], sizeof(texCoords[a]))))
|
||||
if (texCoords)
|
||||
{
|
||||
res = memcmp(&texCoords[a], &texCoords[b], sizeof(texCoords[a]));
|
||||
if (res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mesh.m_pNorms)
|
||||
{
|
||||
res = memcmp(&mesh.m_pNorms[a], &mesh.m_pNorms[b], sizeof(mesh.m_pNorms[a]));
|
||||
if (!res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
if ((mesh.m_pNorms && (res = memcmp(&mesh.m_pNorms[a], &mesh.m_pNorms[b], sizeof(mesh.m_pNorms[a])))) ||
|
||||
(mesh.m_pColor0 && (res = memcmp(&mesh.m_pColor0[a], &mesh.m_pColor0[b], sizeof(mesh.m_pColor0[a])))) ||
|
||||
(mesh.m_pColor1 && (res = memcmp(&mesh.m_pColor1[a], &mesh.m_pColor1[b], sizeof(mesh.m_pColor1[a])))) ||
|
||||
(mesh.m_pVertMats && (res = memcmp(&mesh.m_pVertMats[a], &mesh.m_pVertMats[b], sizeof(mesh.m_pVertMats[a])))) ||
|
||||
(mesh.m_pTangents && (res = memcmp(&mesh.m_pTangents[a], &mesh.m_pTangents[b], sizeof(mesh.m_pTangents[a])))))
|
||||
if (mesh.m_pColor0)
|
||||
{
|
||||
return res < 0;
|
||||
res = memcmp(&mesh.m_pColor0[a], &mesh.m_pColor0[b], sizeof(mesh.m_pColor0[a]));
|
||||
if (!res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
if (mesh.m_pColor1)
|
||||
{
|
||||
res = memcmp(&mesh.m_pColor1[a], &mesh.m_pColor1[b], sizeof(mesh.m_pColor1[a]));
|
||||
if (!res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
if (mesh.m_pVertMats)
|
||||
{
|
||||
res = memcmp(&mesh.m_pVertMats[a], &mesh.m_pVertMats[b], sizeof(mesh.m_pVertMats[a]));
|
||||
if (!res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
if (mesh.m_pTangents)
|
||||
{
|
||||
res = memcmp(&mesh.m_pTangents[a], &mesh.m_pTangents[b], sizeof(mesh.m_pTangents[a]));
|
||||
if (!res)
|
||||
{
|
||||
return res < 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -89,7 +89,9 @@ void CObjManager::UnloadObjects(bool bDeleteAll)
|
||||
m_lstLoadedObjects.clear();
|
||||
}
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
int nNumLeaks = 0;
|
||||
#endif
|
||||
std::vector<CStatObj*> garbage;
|
||||
for (CStatObj* pStatObj = CStatObj::get_intrusive_list_root(); pStatObj; pStatObj = pStatObj->m_next_intrusive)
|
||||
{
|
||||
@@ -1120,8 +1122,7 @@ bool CObjManager::SphereRenderMeshIntersection(IRenderMesh* pRenderMesh, const V
|
||||
|
||||
// get indices
|
||||
vtx_idx* pInds = pRenderMesh->GetIndexPtr(FSL_READ);
|
||||
int nInds = pRenderMesh->GetIndicesCount();
|
||||
assert(nInds % 3 == 0);
|
||||
assert(pRenderMesh->GetIndicesCount() % 3 == 0);
|
||||
|
||||
// test tris
|
||||
TRenderChunkArray& Chunks = pRenderMesh->GetChunks();
|
||||
|
||||
@@ -34,11 +34,6 @@ void CObjManager::RenderDecalAndRoad(IRenderNode* pEnt,
|
||||
{
|
||||
FUNCTION_PROFILER_3DENGINE;
|
||||
|
||||
#ifdef _DEBUG
|
||||
const char* szName = pEnt->GetName();
|
||||
const char* szClassName = pEnt->GetEntityClassName();
|
||||
#endif // _DEBUG
|
||||
|
||||
// do not draw if marked to be not drawn or already drawn in this frame
|
||||
unsigned int nRndFlags = pEnt->GetRndFlags();
|
||||
|
||||
@@ -136,11 +131,6 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
|
||||
|
||||
const CVars* pCVars = GetCVars();
|
||||
|
||||
#ifdef _DEBUG
|
||||
const char* szName = pEnt->GetName();
|
||||
const char* szClassName = pEnt->GetEntityClassName();
|
||||
#endif // _DEBUG
|
||||
|
||||
// do not draw if marked to be not drawn or already drawn in this frame
|
||||
unsigned int nRndFlags = pEnt->GetRndFlags();
|
||||
|
||||
@@ -287,8 +277,8 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
|
||||
|
||||
if (eERType != eERType_Light && (pEnt->m_nInternalFlags & IRenderNode::REQUIRES_NEAREST_CUBEMAP))
|
||||
{
|
||||
uint16 nCubemapTexId = 0;
|
||||
if (!(nCubemapTexId = CheckCachedNearestCubeProbe(pEnt)) || !pCVars->e_CacheNearestCubePicking)
|
||||
uint16 nCubemapTexId = CheckCachedNearestCubeProbe(pEnt);
|
||||
if (!nCubemapTexId || !pCVars->e_CacheNearestCubePicking)
|
||||
{
|
||||
nCubemapTexId = GetNearestCubeProbe(pVisArea, objBox);
|
||||
}
|
||||
@@ -304,7 +294,8 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
|
||||
|
||||
if (pCVars->e_Dissolve && eERType != eERType_Light && passInfo.IsGeneralPass())
|
||||
{
|
||||
if (DrawParams.nDissolveRef = GetDissolveRef(fEntDistance, pEnt->m_fWSMaxViewDist))
|
||||
DrawParams.nDissolveRef = GetDissolveRef(fEntDistance, pEnt->m_fWSMaxViewDist);
|
||||
if (DrawParams.nDissolveRef)
|
||||
{
|
||||
DrawParams.dwFObjFlags |= FOB_DISSOLVE | FOB_DISSOLVE_OUT;
|
||||
if (DrawParams.nDissolveRef == 255)
|
||||
@@ -462,8 +453,7 @@ bool CObjManager::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3
|
||||
|
||||
// get indices
|
||||
vtx_idx* pInds = pRenderMesh->GetIndexPtr(FSL_READ);
|
||||
int nInds = pRenderMesh->GetIndicesCount();
|
||||
assert(nInds % 3 == 0);
|
||||
assert(pRenderMesh->GetIndicesCount() % 3 == 0);
|
||||
|
||||
float fClosestHitDistance = -1;
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ void CObjManager::UnregisterForStreaming(IStreamable* pObj)
|
||||
if (m_arrStreamableObjects.size() > 0)
|
||||
{
|
||||
SStreamAbleObject streamAbleObject(pObj, false);
|
||||
bool deleted = m_arrStreamableObjects.Delete(streamAbleObject);
|
||||
[[maybe_unused]] bool deleted = m_arrStreamableObjects.Delete(streamAbleObject);
|
||||
|
||||
#ifdef OBJMAN_STREAM_STATS
|
||||
if (deleted && m_pStreamListener)
|
||||
@@ -754,7 +754,6 @@ void CObjManager::ProcessObjectsStreaming_Finish()
|
||||
|
||||
LOADING_TIME_PROFILE_SECTION;
|
||||
|
||||
int nNumStreamableObjects = m_arrStreamableObjects.Count();
|
||||
m_bNeedProcessObjectsStreaming_Finish = false;
|
||||
|
||||
FRAME_PROFILER("ProcessObjectsStreaming_Finish", GetSystem(), PROFILE_3DENGINE);
|
||||
@@ -814,7 +813,6 @@ void CObjManager::ProcessObjectsStreaming_Finish()
|
||||
// the pool size in the renderer is sufficient. NOTE: This is a weak
|
||||
// test. Better test would be to actually preallocate the memory here and
|
||||
// only submit the streaming job if the memory could be obtained.
|
||||
int size = pStatObj->GetStreamableContentMemoryUsage();
|
||||
|
||||
if (GetCVars()->e_StreamCgfDebug == 2)
|
||||
{
|
||||
@@ -1016,7 +1014,6 @@ void CObjManager::PrecacheStatObjMaterial(_smart_ptr<IMaterial> pMaterial, const
|
||||
|
||||
if (CMatInfo* pMatInfo = static_cast<CMatInfo*>(pMaterial.get()))
|
||||
{
|
||||
CStatObj* pCStatObj = static_cast<CStatObj*>(pStatObj);
|
||||
pMatInfo->PrecacheMaterial(fEntDistance, (pStatObj ? pStatObj->GetRenderMesh() : NULL), bFullUpdate, bDrawNear);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,6 @@ void COctreeNode::CompileObjects()
|
||||
|
||||
m_lstCasters.reserve(numCasters);
|
||||
|
||||
IObjManager* pObjManager = GetObjManager();
|
||||
|
||||
// update node
|
||||
for (int l = 0; l < eRNListType_ListsNum; l++)
|
||||
@@ -786,7 +785,6 @@ void COctreeNode::GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
for (IRenderNode* pObj = m_arrObjects[l].m_pFirstNode; pObj; pObj = pObj->m_pNext)
|
||||
{
|
||||
EERType eType = pObj->GetRenderNodeType();
|
||||
pObj->GetMemoryUsage(pSizer);
|
||||
}
|
||||
}
|
||||
@@ -1504,16 +1502,6 @@ bool COctreeNode::UpdateStreamingPriority(PodArray<COctreeNode*>& arrRecursion,
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
const char* szName = pObj->GetName();
|
||||
const char* szClassName = pObj->GetEntityClassName();
|
||||
|
||||
if (pObj->GetRndFlags() & ERF_SELECTED)
|
||||
{
|
||||
int selected = 1;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
pObj->FillBBox(objBox);
|
||||
|
||||
// stream more in zoom mode if in frustum
|
||||
|
||||
@@ -580,8 +580,6 @@ void COctreeNode::UpdateObjects(IRenderNode* pObj)
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ThreeDEngineDetailed);
|
||||
|
||||
float fObjMaxViewDistance = 0;
|
||||
size_t numCasters = 0;
|
||||
IObjManager* pObjManager = GetObjManager();
|
||||
|
||||
bool bVegetHasAlphaTrans = false;
|
||||
int nFlags = pObj->GetRndFlags();
|
||||
@@ -659,7 +657,6 @@ void COctreeNode::UpdateObjects(IRenderNode* pObj)
|
||||
}
|
||||
|
||||
bool bUpdateParentShadowFlags = false;
|
||||
bool bUpdateParentOcclusionFlags = false;
|
||||
|
||||
// fill shadow casters list
|
||||
const bool bHasPerObjectShadow = GetCVars()->e_ShadowsPerObject && p3DEngine->GetPerObjectShadow(pObj);
|
||||
@@ -1138,26 +1135,11 @@ bool CObjManager::IsBoxOccluded(const AABB& objBox,
|
||||
CVisAreaManager* pVisAreaManager = GetVisAreaManager();
|
||||
if (GetCVars()->e_OcclusionVolumes && pVisAreaManager && pVisAreaManager->IsOccludedByOcclVolumes(objBox, passInfo))
|
||||
{
|
||||
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
// do not set the lastOccludedMainFrameID because it is camera agnostic so the main pass might occlude
|
||||
// objects that should only be occluded in the render scene to texture pass
|
||||
if (!passInfo.IsRenderSceneToTexturePass())
|
||||
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
{
|
||||
pOcclTestVars->nLastOccludedMainFrameID = mainFrameID;
|
||||
}
|
||||
pOcclTestVars->nLastOccludedMainFrameID = mainFrameID;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
// don't use coverage buffer results if we are checking occlusion for a render to texture camera
|
||||
// because the render to texture pass does not currently write to the coverage buffer and
|
||||
// the frame IDs will not work correctly.
|
||||
if (GetCVars()->e_CoverageBuffer && !passInfo.IsRenderSceneToTexturePass())
|
||||
#else
|
||||
if (GetCVars()->e_CoverageBuffer)
|
||||
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
|
||||
{
|
||||
return pOcclTestVars->nLastOccludedMainFrameID == mainFrameID - 1;
|
||||
}
|
||||
|
||||
@@ -522,12 +522,12 @@ void COctreeNode::LoadSingleObject(byte*& pPtr, [[maybe_unused]] std::vector<ISt
|
||||
{
|
||||
for (uint32 j(0); j < pChunk->m_numVertices; ++j)
|
||||
{
|
||||
SWaterVolumeVertex* pVertex(StepData<SWaterVolumeVertex>(pPtr, eEndian));
|
||||
StepData<SWaterVolumeVertex>(pPtr, eEndian);
|
||||
}
|
||||
|
||||
for (uint32 j(0); j < pChunk->m_numVerticesPhysAreaContour; ++j)
|
||||
{
|
||||
SWaterVolumeVertex* pVertex(StepData<SWaterVolumeVertex>(pPtr, eEndian));
|
||||
StepData<SWaterVolumeVertex>(pPtr, eEndian);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -537,7 +537,7 @@ void COctreeNode::LoadSingleObject(byte*& pPtr, [[maybe_unused]] std::vector<ISt
|
||||
|
||||
int auxCntSrc = pChunk->m_volumeTypeAndMiscBits >> 24, auxCntDst;
|
||||
float* pAuxDataDst = pObj->GetAuxSerializationDataPtr(auxCntDst);
|
||||
const float* pAuxDataSrc = StepData<float>(pPtr, auxCntSrc, eEndian);
|
||||
StepData<float>(pPtr, auxCntSrc, eEndian);
|
||||
memcpy(pAuxDataDst, pAuxDataDst, min(auxCntSrc, auxCntDst) * sizeof(float));
|
||||
|
||||
// read common node data
|
||||
|
||||
@@ -129,7 +129,6 @@ void COcean::Update(const SRenderingPassInfo& passInfo)
|
||||
}
|
||||
|
||||
const CCamera& rCamera = passInfo.GetCamera();
|
||||
int32 nFillThreadID = passInfo.ThreadID();
|
||||
uint32 nBufID = passInfo.GetFrameID() % CYCLE_BUFFERS_NUM;
|
||||
|
||||
Vec3 vCamPos = rCamera.GetPosition();
|
||||
@@ -291,7 +290,6 @@ void COcean::Create()
|
||||
//sqrt_tpl(fx*fx + fy * fy);
|
||||
vv.z = fEdgeDisplace; //!((y==0 ||y == nScrGridSize-1) || (x==0 || x == nScrGridSize-1));
|
||||
|
||||
int32 n = m_pMeshVerts.Count();
|
||||
tmp.xyz = vv;
|
||||
m_pMeshVerts.Add(tmp);
|
||||
}
|
||||
@@ -463,7 +461,6 @@ void COcean::Render(const SRenderingPassInfo& passInfo)
|
||||
C3DEngine* p3DEngine = (C3DEngine*)Get3DEngine();
|
||||
IRenderer* pRenderer(GetRenderer());
|
||||
|
||||
int32 nBufID = (passInfo.GetFrameID() & 1);
|
||||
Vec3 vCamPos = passInfo.GetCamera().GetPosition();
|
||||
float fWaterLevel = OceanToggle::IsActive() ? OceanRequest::GetOceanLevel() : p3DEngine->GetWaterLevel();
|
||||
|
||||
@@ -482,8 +479,6 @@ void COcean::Render(const SRenderingPassInfo& passInfo)
|
||||
|
||||
// test for multiple lights and shadows support
|
||||
|
||||
SRenderObjData* pOD = pRenderer->EF_GetObjData(pObject, true, passInfo.ThreadID());
|
||||
|
||||
m_Camera = passInfo.GetCamera();
|
||||
pObject->m_fAlpha = 1.f;
|
||||
|
||||
@@ -588,7 +583,6 @@ void COcean::SetMaterial(_smart_ptr<IMaterial> pMat)
|
||||
|
||||
void COcean::RenderBottomCap(const SRenderingPassInfo& passInfo)
|
||||
{
|
||||
C3DEngine* p3DEngine = (C3DEngine*)Get3DEngine();
|
||||
|
||||
Vec3 vCamPos = passInfo.GetCamera().GetPosition();
|
||||
|
||||
@@ -828,7 +822,6 @@ bool COcean::IsVisible(const SRenderingPassInfo& passInfo)
|
||||
m_fLastVisibleFrameTime = 0.0f;
|
||||
}
|
||||
|
||||
ITimer* pTimer(gEnv->pTimer);
|
||||
m_fLastVisibleFrameTime += gEnv->pTimer->GetFrameTime();
|
||||
|
||||
if (m_fLastVisibleFrameTime > 2.0f) // at least 2 seconds
|
||||
|
||||
@@ -44,11 +44,6 @@ int CRenderMeshMerger::Cmp_Materials(_smart_ptr<IMaterial> pMat1, _smart_ptr<IMa
|
||||
SShaderItem& shaderItem1 = pMat1->GetShaderItem();
|
||||
SShaderItem& shaderItem2 = pMat2->GetShaderItem();
|
||||
|
||||
#ifdef _DEBUG
|
||||
const char* pName1 = shaderItem1.m_pShader->GetName();
|
||||
const char* pName2 = shaderItem2.m_pShader->GetName();
|
||||
#endif
|
||||
|
||||
// vert format
|
||||
AZ::Vertex::Format vertexFormat1 = shaderItem1.m_pShader->GetVertexFormat();
|
||||
AZ::Vertex::Format vertexFormat2 = shaderItem2.m_pShader->GetVertexFormat();
|
||||
@@ -323,7 +318,6 @@ void CRenderMeshMerger::MakeListOfAllCRenderChunks(SMergeInfo& info)
|
||||
pRM->GetBBox(vMin, vMax);
|
||||
|
||||
// get indices
|
||||
uint32 nIndCount = pRM->GetIndicesCount();
|
||||
vtx_idx* pSrcInds = pRM->GetIndexPtr(FSL_READ);
|
||||
|
||||
Vec3 vOSPos(0, 0, 0);
|
||||
@@ -346,6 +340,7 @@ void CRenderMeshMerger::MakeListOfAllCRenderChunks(SMergeInfo& info)
|
||||
CRenderChunk newMatInfo = pRM->GetChunks()[pRMI->nChunkId];
|
||||
|
||||
#ifdef _DEBUG
|
||||
uint32 nIndCount = pRM->GetIndicesCount();
|
||||
CRenderChunk Ch = newMatInfo;
|
||||
for (uint32 i = Ch.nFirstIndexId; i < Ch.nFirstIndexId + Ch.nNumIndices; i++)
|
||||
{
|
||||
@@ -971,7 +966,6 @@ void CRenderMeshMerger::TryMergingChunks(SMergeInfo& info)
|
||||
else
|
||||
{
|
||||
_smart_ptr<IMaterial> pMat = mergChunk.pMaterial;
|
||||
SShaderItem& shaderItem = pMat->GetShaderItem();
|
||||
chunkVertexFormat = mergChunk.rChunk.m_vertexFormat;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,6 @@ void ShadowCache::InitShadowFrustum(ShadowMapFrustum*& pFr, int nLod, int nFirst
|
||||
return;
|
||||
}
|
||||
|
||||
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
// ShadowCache not supported in render scene to texture passes yet.
|
||||
// It is very common to jump large distances.
|
||||
if (passInfo.IsRenderSceneToTexturePass())
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
|
||||
|
||||
if (!pFr)
|
||||
{
|
||||
pFr = new ShadowMapFrustum;
|
||||
|
||||
@@ -974,11 +974,14 @@ IStatObj* CStatObj::Clone(bool bCloneGeometry, bool bCloneChildren, bool bMeshes
|
||||
pNewObj->m_bSharesChildren = true;
|
||||
}
|
||||
|
||||
if (pNewObj->m_hasClothTangentsData = m_hasClothTangentsData)
|
||||
pNewObj->m_hasClothTangentsData = m_hasClothTangentsData;
|
||||
if (pNewObj->m_hasClothTangentsData)
|
||||
{
|
||||
pNewObj->m_pClothTangentsData = m_pClothTangentsData;
|
||||
}
|
||||
if (pNewObj->m_hasSkinInfo = m_hasSkinInfo)
|
||||
|
||||
pNewObj->m_hasSkinInfo = m_hasSkinInfo;
|
||||
if (pNewObj->m_hasSkinInfo)
|
||||
{
|
||||
pNewObj->m_pSkinInfo = m_pSkinInfo;
|
||||
}
|
||||
|
||||
@@ -148,8 +148,17 @@ int CStatObj::SetDeformationMorphTarget(IStatObj* pDeformed)
|
||||
{
|
||||
((CStatObj*)pDeformed)->MakeRenderMesh();
|
||||
}
|
||||
if (!(pMeshA = GetRenderMesh()) || !(pMeshB = pDeformed->GetRenderMesh()) ||
|
||||
!(pFaceToFace0A = m_pMapFaceToFace0) || !(pFaceToFace0B = ((CStatObj*)pDeformed)->m_pMapFaceToFace0))
|
||||
if (!(pMeshA = GetRenderMesh()) || !(pMeshB = pDeformed->GetRenderMesh()))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pFaceToFace0A = m_pMapFaceToFace0;
|
||||
if (!pFaceToFace0A)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pFaceToFace0B = ((CStatObj*)pDeformed)->m_pMapFaceToFace0;
|
||||
if (!pFaceToFace0B)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1088,11 +1097,20 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
for (i = 0; i < nObj; i++)
|
||||
{
|
||||
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() &&
|
||||
pSubObj->bHidden &&
|
||||
(!strncmp(pSubObj->name, "childof_", 8) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 8)) ||
|
||||
(pSubObj1 = GetSubObject(pSubObj->nParent)) && strstr(pSubObj1->properties, "group")))
|
||||
pSubObj->bHidden && (!strncmp(pSubObj->name, "childof_", 8)))
|
||||
{
|
||||
pSubObj->bHidden = pSubObj1->bHidden;
|
||||
pSubObj1 = FindSubObject((const char*)pSubObj->name + 8);
|
||||
if (pSubObj1)
|
||||
{
|
||||
pSubObj1 = GetSubObject(pSubObj->nParent);
|
||||
if (pSubObj1)
|
||||
{
|
||||
if (strstr(pSubObj1->properties, "group"))
|
||||
{
|
||||
pSubObj->bHidden = pSubObj1->bHidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,12 +1145,19 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
float mindist = 1e10f, curdist;
|
||||
for (j = 0, i0 = i; j < nObj; j++)
|
||||
{
|
||||
if (j != i && (pSubObj1 = GetSubObject(j)) && pSubObj1->pStatObj && ((CStatObj*)pSubObj1->pStatObj)->m_nRenderTrisCount > 0 &&
|
||||
(curdist = (pSubObj1->localTM * (((CStatObj*)pSubObj1->pStatObj)->m_vBoxMin +
|
||||
((CStatObj*)pSubObj1->pStatObj)->m_vBoxMax) * 0.5f - center).len2()) < mindist)
|
||||
if (j != i)
|
||||
{
|
||||
mindist = curdist;
|
||||
i0 = j;
|
||||
pSubObj1 = GetSubObject(j);
|
||||
if (pSubObj1 && pSubObj1->pStatObj && ((CStatObj*)pSubObj1->pStatObj)->m_nRenderTrisCount > 0)
|
||||
{
|
||||
curdist = (pSubObj1->localTM * (((CStatObj*)pSubObj1->pStatObj)->m_vBoxMin +
|
||||
((CStatObj*)pSubObj1->pStatObj)->m_vBoxMax) * 0.5f - center).len2();
|
||||
if (curdist < mindist)
|
||||
{
|
||||
mindist = curdist;
|
||||
i0 = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pSubObj->pStatObj->GetPhysGeom()->pGeom->SetForeignData(GetSubObject(i0)->pStatObj, 0);
|
||||
@@ -1357,7 +1382,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.axisx = pMtx->TransformVector(psj.axisx).normalized();
|
||||
}
|
||||
|
||||
if ((pval = strstr(properties, "limit")) && (pval - 11 < properties - 11 || strncmp(pval - 11, "constraint_", 11)))
|
||||
pval = strstr(properties, "limit");
|
||||
if (pval && (pval - 11 < properties - 11 || strncmp(pval - 11, "constraint_", 11)))
|
||||
{
|
||||
for (pval += 5; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1373,7 +1399,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
// psj.maxForcePush = psj.maxForcePull*2.5f;
|
||||
psj.bBreakable = 1;
|
||||
}
|
||||
if (pval = strstr(properties, "twist"))
|
||||
pval = strstr(properties, "twist");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 5; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1384,7 +1411,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.maxTorqueTwist = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "bend"))
|
||||
pval = strstr(properties, "bend");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 4; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1395,7 +1423,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.maxTorqueBend = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "push"))
|
||||
pval = strstr(properties, "push");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 4; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1406,7 +1435,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.maxForcePush = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "pull"))
|
||||
pval = strstr(properties, "pull");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 4; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1417,7 +1447,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.maxForcePull = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "shift"))
|
||||
pval = strstr(properties, "shift");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 5; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1428,7 +1459,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.maxForceShift = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "damage_accum"))
|
||||
pval = strstr(properties, "damage_accum");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 5; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1439,7 +1471,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.damageAccum = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "damage_accum_threshold"))
|
||||
pval = strstr(properties, "damage_accum_threshold");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += 5; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
@@ -1470,50 +1503,101 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
psj.bDirectBreaksOnly = strstr(properties, "hits_only") != 0;
|
||||
psj.limitConstraint.zero();
|
||||
psj.bConstraintWillIgnoreCollisions = 1;
|
||||
if ((len = 16, pval = strstr(properties, "constraint_limit")) || (len = 5, pval = strstr(properties, "C_lmt")))
|
||||
|
||||
len = 16;
|
||||
pval = strstr(properties, "constraint_limit");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.z = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if ((len = 17, pval = strstr(properties, "constraint_minang")) || (len = 5, pval = strstr(properties, "C_min")))
|
||||
else
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
|
||||
len = 5;
|
||||
pval = strstr(properties, "C_lmt");
|
||||
if (pval)
|
||||
{
|
||||
;
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++)
|
||||
;
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.z = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
}
|
||||
len = 17;
|
||||
pval = strstr(properties, "constraint_minang");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.x = aznumeric_caster(DEG2RAD(atof(pval)));
|
||||
}
|
||||
}
|
||||
if ((len = 17, pval = strstr(properties, "constraint_maxang")) || (len = 5, pval = strstr(properties, "C_max")))
|
||||
else
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
|
||||
len = 5;
|
||||
pval = strstr(properties, "C_min");
|
||||
if (pval)
|
||||
{
|
||||
;
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
|
||||
;
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.x = aznumeric_caster(DEG2RAD(atof(pval)));
|
||||
}
|
||||
}
|
||||
}
|
||||
len = 17;
|
||||
pval = strstr(properties, "constraint_maxang");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.y = aznumeric_caster(DEG2RAD(atof(pval)));
|
||||
}
|
||||
}
|
||||
if ((len = 18, pval = strstr(properties, "constraint_damping")) || (len = 5, pval = strstr(properties, "C_dmp")))
|
||||
else
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++)
|
||||
len = 5;
|
||||
pval = strstr(properties, "C_max");
|
||||
if (pval)
|
||||
{
|
||||
;
|
||||
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.limitConstraint.y = aznumeric_caster(DEG2RAD(atof(pval)));
|
||||
}
|
||||
}
|
||||
}
|
||||
len = 18;
|
||||
pval = strstr(properties, "constraint_damping");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.dampingConstraint = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
len = 5;
|
||||
pval = strstr(properties, "C_dmp");
|
||||
if (pval)
|
||||
{
|
||||
for (pval += len; *pval && !isdigit(*pval); pval++);
|
||||
if (pval)
|
||||
{
|
||||
psj.dampingConstraint = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strstr(properties, "constraint_collides") || strstr(properties, "C_coll"))
|
||||
{
|
||||
psj.bConstraintWillIgnoreCollisions = 0;
|
||||
@@ -1565,94 +1649,107 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
for (i = 0; i < nObj; i++)
|
||||
{
|
||||
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
|
||||
!strncmp(pSubObj->name, "skeleton_", 9) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 9)))
|
||||
!strncmp(pSubObj->name, "skeleton_", 9))
|
||||
{
|
||||
pe_params_skeleton ps;
|
||||
properties = szPropsOverride ? szPropsOverride : (const char*)pSubObj->properties;
|
||||
if (pval = strstr(properties, "stiffness"))
|
||||
pSubObj1 = FindSubObject((const char*)pSubObj->name + 9);
|
||||
if (pSubObj1)
|
||||
{
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
pe_params_skeleton ps;
|
||||
properties = szPropsOverride ? szPropsOverride : (const char*)pSubObj->properties;
|
||||
pval = strstr(properties, "stiffness");
|
||||
if (pval)
|
||||
{
|
||||
ps.stiffness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "thickness"))
|
||||
{
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.stiffness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "thickness");
|
||||
if (pval)
|
||||
{
|
||||
ps.thickness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "max_stretch"))
|
||||
{
|
||||
for (pval += 11; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.thickness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "max_stretch");
|
||||
if (pval)
|
||||
{
|
||||
ps.maxStretch = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "max_impulse"))
|
||||
{
|
||||
for (pval += 11; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 11; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.maxStretch = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "max_impulse");
|
||||
if (pval)
|
||||
{
|
||||
ps.maxImpulse = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "skin_dist"))
|
||||
{
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 11; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.maxImpulse = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "skin_dist");
|
||||
if (pval)
|
||||
{
|
||||
pp.minContactDist = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "hardness"))
|
||||
{
|
||||
for (pval += 8; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 9; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
pp.minContactDist = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "hardness");
|
||||
if (pval)
|
||||
{
|
||||
ps.hardness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
if (pval = strstr(properties, "explosion_scale"))
|
||||
{
|
||||
for (pval += 15; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
for (pval += 8; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.hardness = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
pval = strstr(properties, "explosion_scale");
|
||||
if (pval)
|
||||
{
|
||||
ps.explosionScale = aznumeric_caster(atof(pval));
|
||||
for (pval += 15; *pval && !isdigit(*pval); pval++)
|
||||
{
|
||||
;
|
||||
}
|
||||
if (pval)
|
||||
{
|
||||
ps.explosionScale = aznumeric_caster(atof(pval));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pp.partid = ps.partid = aznumeric_cast<int>((pSubObj1 - &m_subObjects[0])) + id0;
|
||||
pp.idSkeleton = i + id0;
|
||||
pent->SetParams(&pp);
|
||||
pent->SetParams(&ps);
|
||||
((CStatObj*)pSubObj1->pStatObj)->PrepareSkinData(pSubObj1->localTM.GetInverted() * pSubObj->localTM, pSubObj->pStatObj->GetPhysGeom()->pGeom,
|
||||
is_unused(pp.minContactDist) ? 0.0f : pp.minContactDist);
|
||||
pp.partid = ps.partid = aznumeric_cast<int>((pSubObj1 - &m_subObjects[0])) + id0;
|
||||
pp.idSkeleton = i + id0;
|
||||
pent->SetParams(&pp);
|
||||
pent->SetParams(&ps);
|
||||
((CStatObj*)pSubObj1->pStatObj)
|
||||
->PrepareSkinData(
|
||||
pSubObj1->localTM.GetInverted() * pSubObj->localTM, pSubObj->pStatObj->GetPhysGeom()->pGeom,
|
||||
is_unused(pp.minContactDist) ? 0.0f : pp.minContactDist);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1660,14 +1757,22 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
|
||||
new(&pp)pe_params_part;
|
||||
for (i = 0; i < nObj; i++)
|
||||
{
|
||||
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
|
||||
(!strncmp(pSubObj->name, "childof_", 8) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 8)) ||
|
||||
(pSubObj1 = GetSubObject(pSubObj->nParent)) && strstr(pSubObj1->properties, "group")))
|
||||
pSubObj = GetSubObject(i);
|
||||
if (pSubObj->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
|
||||
!strncmp(pSubObj->name, "childof_", 8))
|
||||
{
|
||||
pp.partid = i + id0;
|
||||
pp.idParent = aznumeric_caster(pSubObj1 - &m_subObjects[0]);
|
||||
pent->SetParams(&pp);
|
||||
pSubObj->bHidden = true;
|
||||
pSubObj1 = FindSubObject((const char*)pSubObj->name + 8);
|
||||
if (pSubObj1)
|
||||
{
|
||||
pSubObj1 = GetSubObject(pSubObj->nParent);
|
||||
if (pSubObj1 && strstr(pSubObj1->properties, "group"))
|
||||
{
|
||||
pp.partid = i + id0;
|
||||
pp.idParent = aznumeric_caster(pSubObj1 - &m_subObjects[0]);
|
||||
pent->SetParams(&pp);
|
||||
pSubObj->bHidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,6 @@ void CStatObj::FillRenderObject(const SRendParams& rParams, IRenderNode* pRender
|
||||
// Specify transformation
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
IRenderer* pRend = GetRenderer();
|
||||
|
||||
assert(pObj);
|
||||
if (!pObj)
|
||||
|
||||
@@ -612,7 +612,6 @@ void CTimeOfDay::UpdateEnvLighting(bool forceUpdate)
|
||||
|
||||
// Calculating the energy multiplier where mid-day sun is 1.0 and night is 0
|
||||
const float noonTime = 12.0f;
|
||||
float dayTime = p3DEngine->m_duskEnd - p3DEngine->m_dawnStart;
|
||||
|
||||
if (m_fTime <= noonTime)
|
||||
{
|
||||
@@ -911,7 +910,6 @@ void CTimeOfDay::MigrateLegacyData(bool bSunIntensity, const XmlNodeRef& node)
|
||||
varHDRPower.pInterpolator->InterpolateFloat(time, hdrPower);
|
||||
|
||||
const float HDRDynamicMultiplier = 2.0f;
|
||||
float hdrMult = powf(HDRDynamicMultiplier, hdrPower);
|
||||
float sunColorLum = sunColor[0] * 0.2126f + sunColor[1] * 0.7152f + sunColor[2] * 0.0722f;
|
||||
float sunIntensity = sunMult * sunColorLum * 10000.0f * gf_PI;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ bool CVisAreaManager::GetCompiledData([[maybe_unused]] byte* pData, [[maybe_unus
|
||||
# else
|
||||
float fStartTime = GetCurAsyncTimeSec();
|
||||
|
||||
bool bObjs(!pExportInfo || pExportInfo->nObjTypeMask);
|
||||
|
||||
// PrintMessage("Exporting indoor data (%s, %.2f MB) ...",
|
||||
|
||||
@@ -206,8 +205,6 @@ bool CVisAreaManager::Load_T(T& f, int& nDataSize, SVisAreaManChunkHeader* pVisA
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool bObjs(!pExportInfo || pExportInfo->nObjTypeMask);
|
||||
AABB* pBox = (pExportInfo && !pExportInfo->areaBox.IsReset()) ? &pExportInfo->areaBox : NULL;
|
||||
|
||||
EEndian eEndian = (pVisAreaManagerChunkHeader->nFlags & SERIALIZATION_FLAG_BIG_ENDIAN) ? eBigEndian : eLittleEndian;
|
||||
|
||||
|
||||
@@ -1357,12 +1357,17 @@ int OnWaterUpdate(const EventPhysAreaChange* pEvent)
|
||||
void CWaterVolumeRenderNode::SyncToPhysMesh(const QuatT& qtSurface, IGeometry* pSurface, float depth)
|
||||
{
|
||||
mesh_data* pmd;
|
||||
if (!pSurface || pSurface->GetType() != GEOM_TRIMESH || !(pmd = (mesh_data*)pSurface->GetData()))
|
||||
if (!pSurface || pSurface->GetType() != GEOM_TRIMESH)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool bResized = false;
|
||||
if (bResized = m_waterSurfaceVertices.size() != pmd->nVertices)
|
||||
pmd = (mesh_data*)pSurface->GetData();
|
||||
if (!pmd)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool bResized = m_waterSurfaceVertices.size() != pmd->nVertices;
|
||||
if (bResized)
|
||||
{
|
||||
m_waterSurfaceVertices.resize(pmd->nVertices);
|
||||
}
|
||||
|
||||
@@ -130,11 +130,13 @@ void CCoverageBuffer::ClipPolygon(PodArray<Vec3>& PolygonOut, const PodArray<Vec
|
||||
}
|
||||
|
||||
// check result
|
||||
#if !defined(NDEBUG)
|
||||
for (int i = 0; i < PolygonOut.Count(); i++)
|
||||
{
|
||||
float d1 = -ClipPlane.DistFromPlane(PolygonOut.GetAt(i));
|
||||
float d1 = -ClipPlane.DistFromPlane(PolygonOut.GetAt(i));
|
||||
assert(d1 >= -0.01f);
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(PolygonOut.Count() == 0 || PolygonOut.Count() >= 3);
|
||||
}
|
||||
@@ -209,4 +211,4 @@ void CPolygonClipContext::GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(m_lstPolygonA);
|
||||
pSizer->AddObject(m_lstPolygonB);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ void CVars::Init()
|
||||
|
||||
#ifndef _RELEASE
|
||||
DefineConstIntCVar(e_DebugDrawListSize, 24, VF_DEV_ONLY, "num objects in the list for e_DebugDraw list infodebug");
|
||||
ICVar* e_DebugDrawListFilter = REGISTER_STRING_CB_DEV_ONLY("e_DebugDrawListFilter", "", VF_NULL,
|
||||
REGISTER_STRING_CB_DEV_ONLY("e_DebugDrawListFilter", "", VF_NULL,
|
||||
"filter for e_DebugDraw list. Combine object type letters to create the filter\n"
|
||||
"(example: e_DebugDrawListFilter BVC = shows Characters+StatObject). 'all' = no filter.\n"
|
||||
" C: Character\n"
|
||||
|
||||
Reference in New Issue
Block a user