Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Commit d21172c

Browse files
ricchiojricchioj
ricchioj
authored and
ricchioj
committed
Lumberyard Release 1.17.0.0
Binaries Uncompressed Size: 19.26GB (20681046768 bytes)
1 parent 01c1c1a commit d21172c

File tree

548 files changed

+23653
-8467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

548 files changed

+23653
-8467
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ about: Create a bug report to help us improve.
88
Please provide a concise description of the bug.
99

1010
**Steps to reproduce**
11-
Please provide steps to reproduce the bug. The more detail you provide, the more likely we'll be able to reproduce it.
11+
Please provide steps to reproduce the bug. The more detail you provide, the more likely we'll be able to reproduce it.
1212

1313
**Expected behavior**
1414
Please provide a concise description of what you expected to happen.
1515

1616
**Screenshots/Logs**
17-
Please include any relevant screenshots and log files from your game project directory (e.g., C:\Amazon\lumberyard\1.15.0.0\dev\Cache\YOURPROJECT\pc\user\log). Note that you are posting to a public forum so please remove any sensitive information from your log files such as project name & path, IP address, credentials etc.
17+
Please include any relevant screenshots and log files from your game project directory (e.g., C:\Amazon\lumberyard\1.15.0.0\dev\Cache\YOURPROJECT\pc\user\log). Note that you are posting to a public forum so please remove any sensitive information from your log files such as project name & path, IP address, credentials etc.
1818

1919
**Lumberyard version**
2020
State the version of Lumberyard in which you discovered this bug (e.g., v1.14.0.1 or v1.15.0.0 etc.).

bootstrap_config.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Checksum": "c8357b7f55b1eb90c45d51ffd1fc3a6721383151cfa44286064d3567032b777cc68da25c9682f26f42c1ca0980942105c5a028a80d5f747521ddd198b695623b",
3-
"URL": "https://d3dn1rjl3s1m7l.cloudfront.net/1.16.0.0/lumberyard-1.16-754138a-pc_111218_184410-binaries.zip",
4-
"Uncompressed Size": 20646737921
2+
"Checksum": "828844599af1f9f3c53384e92e9751fe558b4990779fc676ba893b0649759a231a100fae877055f5d0e048fcbd2e3c4f2c8dd1f309d5bf0a0e27e1e794705730",
3+
"URL": "https://d3dn1rjl3s1m7l.cloudfront.net/1.17.0.0/lumberyard-1.17-785010a-pc_121918_151131-binaries.zip",
4+
"Uncompressed Size": 20681046768
55
}

dev/Code/CryEngine/Cry3DEngine/3DEngine_Jobs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ ITimeOfDay* C3DEngine::GetTimeOfDay()
311311
}
312312

313313
///////////////////////////////////////////////////////////////////////////////
314-
void C3DEngine::TraceFogVolumes(const Vec3& worldPos, ColorF& fogVolumeContrib, const SRenderingPassInfo& passInfo)
314+
void C3DEngine::TraceFogVolumes(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality)
315315
{
316-
CFogVolumeRenderNode::TraceFogVolumes(worldPos, fogVolumeContrib, passInfo);
316+
CFogVolumeRenderNode::TraceFogVolumes(vPos, objBBox, fogVolData, passInfo, fogVolumeShadingQuality);
317317
}
318318

319319
///////////////////////////////////////////////////////////////////////////////

dev/Code/CryEngine/Cry3DEngine/3dEngine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ class C3DEngine
767767
virtual void ClearAllPrecachePoints();
768768
virtual void GetPrecacheRoundIds(int pRoundIds[MAX_STREAM_PREDICTION_ZONES]);
769769

770-
virtual void TraceFogVolumes(const Vec3& worldPos, ColorF& fogVolumeContrib, const SRenderingPassInfo& passInfo);
770+
virtual void TraceFogVolumes(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality);
771771

772772
virtual Vec3 GetSunColor() const;
773773
virtual float GetSSAOAmount() const;

dev/Code/CryEngine/Cry3DEngine/3dEngineLoad.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,6 @@ void C3DEngine::UnloadLevel()
604604
stl::free_container(m_RenderingPassCameras[1]);
605605
stl::free_container(m_deferredRenderComponentStreamingPriorityUpdates);
606606

607-
for (uint i = 0; i < m_lstCustomShadowFrustums.size(); ++i)
608-
{
609-
m_lstCustomShadowFrustums[i].~ShadowMapFrustum();
610-
}
611607
stl::free_container(m_lstCustomShadowFrustums);
612608

613609
m_nWindSamplePositions = 0;
@@ -1206,12 +1202,11 @@ void C3DEngine::LoadEnvironmentSettingsFromXML(XmlNodeRef pInputNode, int nSID)
12061202
char szTerrainWaterMatName[256];
12071203
cry_strcpy(szTerrainWaterMatName, GetXMLAttribText(pInputNode, "Ocean", "Material", "EngineAssets/Materials/Water/Ocean_default"));
12081204
m_pTerrainWaterMat = szTerrainWaterMatName[0] ? GetMatMan()->LoadMaterial(szTerrainWaterMatName, false) : nullptr;
1209-
}
12101205

1211-
1212-
if (m_pTerrain)
1213-
{
1214-
m_pTerrain->InitTerrainWater(m_pTerrainWaterMat);
1206+
if (m_pTerrain)
1207+
{
1208+
m_pTerrain->InitTerrainWater(m_pTerrainWaterMat);
1209+
}
12151210
}
12161211

12171212
m_oceanWindDirection = (float) atof(GetXMLAttribText(pInputNode, "OceanAnimation", "WindDirection", "1.0"));
@@ -1342,7 +1337,7 @@ void C3DEngine::LoadEnvironmentSettingsFromXML(XmlNodeRef pInputNode, int nSID)
13421337
ITexture* pTex = 0;
13431338
if (cloudShadowTexture[0] != '\0')
13441339
{
1345-
pTex = GetRenderer()->EF_LoadTexture(cloudShadowTexture);
1340+
pTex = GetRenderer()->EF_LoadTexture(cloudShadowTexture, FT_DONT_STREAM);
13461341
}
13471342

13481343
m_nCloudShadowTexId = pTex ? pTex->GetTextureID() : 0;

dev/Code/CryEngine/Cry3DEngine/DecalRenderNode.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ void CDecalRenderNode::Render(const SRendParams& rParam, const SRenderingPassInf
367367
}
368368
SDeferredDecal newItem;
369369
newItem.fAlpha = m_decalProperties.m_opacity;
370+
newItem.angleAttenuation = m_decalProperties.m_angleAttenuation;
370371
newItem.pMaterial = m_pMaterial;
371372
newItem.projMatrix = m_Matrix;
372373
newItem.nSortOrder = m_decalProperties.m_sortPrio;

dev/Code/CryEngine/Cry3DEngine/FogVolumeRenderNode.h

+8-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class CFogVolumeRenderNode
2727
static void StaticReset();
2828

2929
static void SetTraceableArea(const AABB& traceableArea, const SRenderingPassInfo& passInfo);
30-
static void TraceFogVolumes(const Vec3& worldPos, ColorF& fogColor, const SRenderingPassInfo& passInfo);
31-
30+
static void TraceFogVolumes(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality);
31+
static bool OverlapProjectedAABB(const AABB& objBBox0, const AABB& objBBox1, const CCamera& camera);
3232
public:
3333
CFogVolumeRenderNode();
3434

@@ -59,9 +59,14 @@ class CFogVolumeRenderNode
5959
virtual void SetBBox(const AABB& WSBBox) { m_WSBBox = WSBBox; }
6060
virtual void FillBBox(AABB& aabb);
6161
virtual void OffsetPosition(const Vec3& delta);
62+
float GetGlobalDensity() const { return m_globalDensity; }
63+
float GetDensityoffset() const { return m_densityOffset; }
64+
Vec3 GetHeightFallOffBasePoint() const { return m_heightFallOffBasePoint; }
65+
Vec3 GetHeightFallOffDirScaled() const { return m_heightFallOffDirScaled; }
6266

63-
ILINE bool IsAffectsThisAreaOnly() const { return m_affectsThisAreaOnly; }
6467

68+
ILINE bool IsAffectsThisAreaOnly() const { return m_affectsThisAreaOnly; }
69+
int GetVolumeType() const { return m_volumeType; }
6570
private:
6671
static void RegisterFogVolume(const CFogVolumeRenderNode* pFogVolume);
6772
static void UnregisterFogVolume(const CFogVolumeRenderNode* pFogVolume);
@@ -72,7 +77,6 @@ class CFogVolumeRenderNode
7277
void UpdateFogVolumeMatrices();
7378
void UpdateWorldSpaceBBox();
7479
void UpdateHeightFallOffBasePoint();
75-
7680
ColorF GetFogColor() const;
7781
Vec2 GetSoftEdgeLerp(const Vec3& viewerPosOS) const;
7882
bool IsViewerInsideVolume(const SRenderingPassInfo& passInfo) const;

dev/Code/CryEngine/Cry3DEngine/FogVolumeRenderNode_Jobs.cpp

+128-15
Original file line numberDiff line numberDiff line change
@@ -25,61 +25,175 @@ inline static float expf_s(float arg)
2525
return expf(clamp_tpl(arg, -80.0f, 80.0f));
2626
}
2727

28+
AABB UnprojectAABB2D(const AABB& aabb, const CCamera& camera)
29+
{
30+
Vec3 results[4];
31+
camera.Unproject(Vec3(aabb.min.x, aabb.min.y, 1), results[0]);
32+
camera.Unproject(Vec3(aabb.max.x, aabb.min.y, 1), results[1]);
33+
camera.Unproject(Vec3(aabb.max.x, aabb.max.y, 1), results[2]);
34+
camera.Unproject(Vec3(aabb.min.x, aabb.max.y, 1), results[3]);
35+
36+
AABB newAABB(AABB::RESET);
37+
newAABB.Add(results[0]);
38+
newAABB.Add(results[1]);
39+
newAABB.Add(results[2]);
40+
newAABB.Add(results[3]);
41+
return newAABB;
42+
}
43+
44+
AABB GetProjectedQuadFromAABB(const AABB& aabb, const CCamera& camera)
45+
{
46+
// Get all 8 points of the AABB
47+
48+
Vec3 aabbPoints[] =
49+
{
50+
Vec3(aabb.max.x, aabb.max.y, aabb.max.z),
51+
Vec3(aabb.max.x, aabb.min.y, aabb.max.z),
52+
Vec3(aabb.min.x, aabb.min.y, aabb.max.z),
53+
Vec3(aabb.min.x, aabb.max.y, aabb.max.z),
54+
Vec3(aabb.max.x, aabb.max.y, aabb.min.z),
55+
Vec3(aabb.max.x, aabb.min.y, aabb.min.z),
56+
Vec3(aabb.min.x, aabb.min.y, aabb.min.z),
57+
Vec3(aabb.min.x, aabb.max.y, aabb.min.z),
58+
};
59+
const int numAABBPoints = AZ_ARRAY_SIZE(aabbPoints);
60+
61+
AZ_Assert(numAABBPoints==8,"you should have 8 points in the aabb");
62+
63+
// Project each AABB point and construct another AABB.
64+
AABB quadResult(AABB::RESET);
65+
for (int i = 0; i < numAABBPoints; ++i)
66+
{
67+
Vec3 projectedPoint;
68+
camera.Project(aabbPoints[i], projectedPoint);
69+
quadResult.Add(projectedPoint);
70+
}
71+
return quadResult;
72+
}
73+
74+
75+
// To know if aabb are aligned with camera, we test if projected quads overlap.
76+
bool CFogVolumeRenderNode::OverlapProjectedAABB(const AABB& aabb0, const AABB& aabb1, const CCamera& camera)
77+
{
78+
// quads are AABB2D.
79+
AABB quad0 = GetProjectedQuadFromAABB(aabb0, camera);
80+
AABB quad1 = GetProjectedQuadFromAABB(aabb1, camera);
81+
bool bOverlap = Overlap::AABB_AABB2D(quad0, quad1);
82+
return bOverlap;
83+
}
84+
85+
void AverageFogVolume(SFogVolumeData& fogVolData, const CFogVolumeRenderNode* pFogVol)
86+
{
87+
AABB& avgAABBoxOut = fogVolData.avgAABBox;
88+
avgAABBoxOut.Add(pFogVol->GetBBox());
89+
90+
// ratio is used to approximate fog volumes contribution depending of the importance of their size.
91+
float ratio = pFogVol->GetBBox().GetRadius() / avgAABBoxOut.GetRadius();
92+
fogVolData.m_heightFallOffBasePoint = Lerp(fogVolData.m_heightFallOffBasePoint,pFogVol->GetHeightFallOffBasePoint(), ratio);
93+
fogVolData.m_heightFallOffDirScaled = Lerp(fogVolData.m_heightFallOffDirScaled,pFogVol->GetHeightFallOffDirScaled(), ratio);
94+
fogVolData.m_densityOffset = Lerp(fogVolData.m_densityOffset, pFogVol->GetDensityoffset(), ratio);
95+
fogVolData.m_globalDensity = Lerp(fogVolData.m_globalDensity, pFogVol->GetGlobalDensity(), ratio);
96+
fogVolData.m_volumeType |= pFogVol->GetVolumeType();
97+
}
2898

2999
///////////////////////////////////////////////////////////////////////////////
100+
// TraceFogVolumes :
101+
// if object intersects/is aligned with fog volumes then register these fog volumes,
102+
// check if object is in front of the fog volume and compute average color.
103+
// if highVertexShadingQuality average fog volume box.
30104
///////////////////////////////////////////////////////////////////////////////
31-
void CFogVolumeRenderNode::TraceFogVolumes(const Vec3& worldPos, ColorF& fogColor, const SRenderingPassInfo& passInfo)
105+
void CFogVolumeRenderNode::TraceFogVolumes(const Vec3& objPosition, const AABB& objAABB, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality)
32106
{
33107
FUNCTION_PROFILER_3DENGINE;
34108
PrefetchLine(&s_tracableFogVolumeArea, 0);
35109

36110
// init default result
37111
ColorF localFogColor = ColorF(0.0f, 0.0f, 0.0f, 0.0f);
38112

39-
113+
// We will "accumulate" fog volumes contribution the same way that fog color.
114+
40115
// trace is needed when volumetric fog is off.
41116
if (GetCVars()->e_Fog && GetCVars()->e_FogVolumes && (GetCVars()->e_VolumetricFog == 0))
42117
{
118+
const Vec3 worldPos = objPosition;
119+
43120
// init view ray
44121
Vec3 camPos(s_tracableFogVolumeArea.GetCenter());
45-
Lineseg lineseg(camPos, worldPos);
122+
Lineseg lineseg(camPos, objPosition);
46123

47124
#ifdef _DEBUG
48125
const SCachedFogVolume* prev(0);
49126
#endif
50-
127+
51128
// loop over all traceable fog volumes
52129
CachedFogVolumes::const_iterator itEnd(s_cachedFogVolumes.end());
53130
for (CachedFogVolumes::const_iterator it(s_cachedFogVolumes.begin()); it != itEnd; ++it)
54131
{
55132
// get current fog volume
56133
const CFogVolumeRenderNode* pFogVol((*it).m_pFogVol);
57-
134+
135+
bool isAligned = false;
136+
bool isFrontOfBoxCenter = false;
58137
// only trace visible fog volumes
59138
if (!(pFogVol->GetRndFlags() & ERF_HIDDEN))
60139
{
140+
bool projectedAABBIntersect = false;
141+
bool isInside = Overlap::Point_AABB(objPosition, pFogVol->m_WSBBox);
142+
143+
if (fogVolumeShadingQuality)
144+
{
145+
projectedAABBIntersect = OverlapProjectedAABB(pFogVol->m_WSBBox, objAABB, passInfo.GetCamera());
146+
isInside = isInside || Overlap::AABB_AABB(objAABB, pFogVol->m_WSBBox);
147+
}
148+
61149
// check if view ray intersects with bounding box of current fog volume
62-
if (Overlap::Lineseg_AABB(lineseg, pFogVol->m_WSBBox))
150+
isAligned = Overlap::Lineseg_AABB(lineseg, pFogVol->m_WSBBox);
151+
if (projectedAABBIntersect || isAligned)
63152
{
64153
// compute contribution of current fog volume
65-
ColorF color;
66-
if (0 == pFogVol->m_volumeType)
154+
ColorF color(0,0,0);
155+
156+
// Get distance camera to fog volume.
157+
const CCamera& cam(passInfo.GetCamera());
158+
Vec3 cameraToObject(objPosition - cam.GetPosition());
159+
Vec3 cameraToFogVolume(pFogVol->m_WSBBox.GetCenter() - cam.GetPosition());
160+
isFrontOfBoxCenter = (cameraToFogVolume.GetLengthSquared() > cameraToObject.GetLengthSquared());
161+
// if particle is in front of the box center and not inside the box, then do not accumulate fog color.
162+
if (isFrontOfBoxCenter && !isInside)
163+
{
164+
continue;
165+
}
166+
167+
if (fogVolumeShadingQuality)
67168
{
68-
pFogVol->GetVolumetricFogColorEllipsoid(worldPos, passInfo, color);
169+
// Accumulate this fogVolData
170+
AverageFogVolume(fogVolData, pFogVol);
171+
color = pFogVol->GetFogColor();
69172
}
70173
else
71174
{
72-
pFogVol->GetVolumetricFogColorBox(worldPos, passInfo, color);
175+
if (0 == pFogVol->m_volumeType)
176+
{
177+
pFogVol->GetVolumetricFogColorEllipsoid(worldPos, passInfo, color);
178+
}
179+
else
180+
{
181+
pFogVol->GetVolumetricFogColorBox(worldPos, passInfo, color);
182+
}
183+
184+
color.a = 1.0f - color.a; // 0 = transparent, 1 = opaque
73185
}
74-
75-
color.a = 1.0f - color.a; // 0 = transparent, 1 = opaque
76-
186+
187+
188+
77189
// blend fog colors
78190
localFogColor.r = Lerp(localFogColor.r, color.r, color.a);
79191
localFogColor.g = Lerp(localFogColor.g, color.g, color.a);
80192
localFogColor.b = Lerp(localFogColor.b, color.b, color.a);
81193
localFogColor.a = Lerp(localFogColor.a, 1.0f, color.a);
194+
82195
}
196+
83197
}
84198

85199
#ifdef _DEBUG
@@ -100,8 +214,7 @@ void CFogVolumeRenderNode::TraceFogVolumes(const Vec3& worldPos, ColorF& fogColo
100214
}
101215

102216
localFogColor.a = 1.0f - localFogColor.a;
103-
104-
fogColor = localFogColor;
217+
fogVolData.fogColor = localFogColor;
105218
}
106219

107220
///////////////////////////////////////////////////////////////////////////////

dev/Code/CryEngine/Cry3DEngine/ParticleContainer.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ void CParticleContainer::UpdateParticleStates(SParticleUpdateContext& context)
771771
}
772772
for (ParticleList<CParticle>::iterator pPart(m_Particles); pPart; )
773773
{
774+
// Update the particle before the IsAlive check so it can be removed immediately if it is killed by the update
775+
pPart->Update(context, context.fUpdateTime);
776+
774777
if (!pPart->IsAlive(fLifetimeCheck))
775778
{
776779
if (m_pParams->bRemainWhileVisible)
@@ -785,10 +788,6 @@ void CParticleContainer::UpdateParticleStates(SParticleUpdateContext& context)
785788
ERASE_PARTICLE(pPart)
786789
}
787790
}
788-
else
789-
{
790-
pPart->Update(context, context.fUpdateTime);
791-
}
792791

793792
if (!context.aParticleSort.empty() && !params.IsConnectedParticles())
794793
{

dev/Code/CryEngine/Cry3DEngine/ParticleEmitter.cpp

+15-3
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,21 @@ void CParticleEmitter::Render(SRendParams const& RenParams, const SRenderingPass
12461246
SPartRenderParams PartParams;
12471247
ZeroStruct(PartParams);
12481248

1249-
ColorF fogVolumeContrib;
1250-
CFogVolumeRenderNode::TraceFogVolumes(GetPos(), fogVolumeContrib, passInfo);
1251-
PartParams.m_nFogVolumeContribIdx = GetRenderer()->PushFogVolumeContribution(fogVolumeContrib, passInfo);
1249+
// Pass the bounding box and the high quality option
1250+
// That has been set in the particle editor.
1251+
bool fogVolumeShadingQuality = false;
1252+
1253+
static ICVar* pCVarFogVolumeShadingQuality = gEnv->pConsole->GetCVar("e_FogVolumeShadingQuality");
1254+
if ((pCVarFogVolumeShadingQuality->GetIVal() > 0) && (m_Containers.size() > 0))
1255+
{
1256+
const ResourceParticleParams& params = m_Containers.front().GetParams();
1257+
fogVolumeShadingQuality = params.FogVolumeShadingQualityHigh;
1258+
}
1259+
1260+
SFogVolumeData fogVolData;
1261+
CFogVolumeRenderNode::TraceFogVolumes(GetPos(), GetBBox(), fogVolData, passInfo, fogVolumeShadingQuality);
1262+
1263+
PartParams.m_nFogVolumeContribIdx = GetRenderer()->PushFogVolumeContribution(fogVolData, passInfo);
12521264

12531265
// Compute camera distance with top effect's SortBoundsScale.
12541266
PartParams.m_fMainBoundsScale = m_pTopEffect->IsEnabled() ? +m_pTopEffect->GetParams().fSortBoundsScale : 1.f;

dev/Code/CryEngine/Cry3DEngine/cvars.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ void CVars::Init()
851851
"LOD distance ratio for objects");
852852
REGISTER_CVAR(e_LodFaceAreaTargetSize, 0.005f, VF_NULL,
853853
"Threshold used for LOD computation.");
854+
REGISTER_CVAR(e_FogVolumeShadingQuality, 0, VF_NULL,
855+
"Fog Volume Shading Quality 0: standard, 1:high (better fog volume interaction)");
854856
DefineConstFloatCVar(e_LodCompMaxSize, VF_NULL,
855857
"Affects LOD selection for big objects, small number will switch more objects into lower LOD");
856858
REGISTER_CVAR(e_ViewDistRatio, 60.0f, VF_CVARGRP_IGNOREINREALVAL,

dev/Code/CryEngine/Cry3DEngine/cvars.h

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ struct CVars
373373
DeclareConstIntCVar(e_TerrainTextureDebug, 0);
374374
int e_Entities;
375375
int e_CoverageBuffer;
376+
int e_FogVolumeShadingQuality;
376377
int e_ScreenShotQuality;
377378
DeclareConstFloatCVar(e_FoliageBranchesDamping);
378379
int e_levelStartupFrameNum;

0 commit comments

Comments
 (0)