Cut 8: Forward+ Vulkan cutover, atmospheric scattering sky, volumetric fog, SSR, 4-split shadows, & linear HDR
This commit is contained in:
parent
c789fe8af8
commit
35626ccd02
21 changed files with 1232 additions and 227 deletions
|
|
@ -603,7 +603,7 @@ public partial class ArenaRenderer : Node3D
|
|||
vis.Visual.Root.Transform = new Transform3D(new Basis(q), pos);
|
||||
|
||||
float distSq = hasCam ? pos.DistanceSquaredTo(camPos) : 0f;
|
||||
bool castShadows = !hasCam || c.Id == localId || distSq <= 55f * 55f;
|
||||
bool castShadows = !hasCam || c.Id == localId || distSq <= 120f * 120f;
|
||||
bool useStaticLod = hasCam && c.Id != localId && !vis.Visual.HasAnyStrippedCell &&
|
||||
(vis.Visual.IsStaticLod ? distSq > 64f * 64f : distSq > 68f * 68f);
|
||||
vis.Visual.SetLodState(useStaticLod, castShadows);
|
||||
|
|
@ -706,7 +706,7 @@ public partial class ArenaRenderer : Node3D
|
|||
if (hasCam)
|
||||
{
|
||||
float distSq = specPos.DistanceSquaredTo(camPos);
|
||||
castShadows = distSq <= 55f * 55f;
|
||||
castShadows = distSq <= 120f * 120f;
|
||||
if (!vis.Visual.HasAnyStrippedCell)
|
||||
{
|
||||
useStaticLod = vis.Visual.IsStaticLod ? distSq > 50f * 50f : distSq > 55f * 55f;
|
||||
|
|
@ -777,14 +777,14 @@ public partial class ArenaRenderer : Node3D
|
|||
}
|
||||
else if (s.Stance == SpectatorStance.Cleared)
|
||||
{
|
||||
vis.HaloMat.AlbedoColor = new Color(1.0f, 0.22f, 0.18f, 0.9f);
|
||||
vis.HaloMat.AlbedoColor = new Color(1.8f, 0.32f, 0.24f, 0.9f);
|
||||
vis.HaloMat.Emission = new Color(1.0f, 0.2f, 0.15f);
|
||||
vis.HaloMat.EmissionEnergyMultiplier = 2.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
float pulse = 1.6f + 1.2f * MathF.Sin(elapsedSeconds * 10f);
|
||||
vis.HaloMat.AlbedoColor = new Color(1.0f, 0.1f, 0.1f, 0.95f);
|
||||
vis.HaloMat.AlbedoColor = new Color(pulse, 0.14f, 0.12f, 0.95f);
|
||||
vis.HaloMat.Emission = new Color(1.0f, 0.08f, 0.08f);
|
||||
vis.HaloMat.EmissionEnergyMultiplier = pulse;
|
||||
}
|
||||
|
|
@ -848,7 +848,7 @@ public partial class ArenaRenderer : Node3D
|
|||
|
||||
var laserMat = new StandardMaterial3D
|
||||
{
|
||||
AlbedoColor = new Color(1f, 0.15f, 0.15f, 0.85f),
|
||||
AlbedoColor = new Color(2.2f, 0.24f, 0.20f, 0.85f),
|
||||
EmissionEnabled = true,
|
||||
Emission = new Color(1f, 0.12f, 0.1f),
|
||||
EmissionEnergyMultiplier = 2.2f,
|
||||
|
|
@ -973,9 +973,11 @@ public partial class ArenaRenderer : Node3D
|
|||
if (discCount < _dropDiscMm.InstanceCount)
|
||||
{
|
||||
_dropDiscMm.SetInstanceTransform(discCount, new Transform3D(Basis.Identity, new Vector3(d.X, entry.BaseY + bob + 0.08f, d.Z)));
|
||||
Color goldLin = TouristGold.SrgbToLinear();
|
||||
Color oliveLin = OlivePaint.SrgbToLinear();
|
||||
Color dCol = entry.IsImperial
|
||||
? new Color(TouristGold.R * 2.2f, TouristGold.G * 2.2f, TouristGold.B * 2.2f, 0.82f)
|
||||
: new Color(OlivePaint.R * 1.5f, OlivePaint.G * 1.5f, OlivePaint.B * 1.5f, 0.72f);
|
||||
? new Color(goldLin.R * 2.2f, goldLin.G * 2.2f, goldLin.B * 2.2f, 0.82f)
|
||||
: new Color(oliveLin.R * 1.35f, oliveLin.G * 1.35f, oliveLin.B * 1.35f, 0.72f);
|
||||
_dropDiscMm.SetInstanceCustomData(discCount, dCol);
|
||||
discCount++;
|
||||
}
|
||||
|
|
@ -993,7 +995,7 @@ public partial class ArenaRenderer : Node3D
|
|||
if (hasCam)
|
||||
{
|
||||
useFarLod = cv.IsStaticLod ? distSq > 50f * 50f : distSq > 55f * 55f;
|
||||
castShadows = distSq <= 70f * 70f;
|
||||
castShadows = distSq <= 120f * 120f;
|
||||
}
|
||||
cv.SetLodState(useFarLod, castShadows);
|
||||
cv.SubmitToPool(_partPool);
|
||||
|
|
@ -1001,7 +1003,8 @@ public partial class ArenaRenderer : Node3D
|
|||
if (discCount < _dropDiscMm.InstanceCount)
|
||||
{
|
||||
_dropDiscMm.SetInstanceTransform(discCount, new Transform3D(Basis.FromScale(new Vector3(2.4f, 1f, 2.4f)), new Vector3(d.X, entry.BaseY + 0.06f, d.Z)));
|
||||
_dropDiscMm.SetInstanceCustomData(discCount, new Color(CyanSalvage.R * 1.8f, CyanSalvage.G * 1.8f, CyanSalvage.B * 1.8f, 0.65f));
|
||||
Color cyanLin = CyanSalvage.SrgbToLinear();
|
||||
_dropDiscMm.SetInstanceCustomData(discCount, new Color(cyanLin.R * 1.8f, cyanLin.G * 1.8f, cyanLin.B * 1.8f, 0.65f));
|
||||
discCount++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1049,7 +1052,7 @@ public partial class ArenaRenderer : Node3D
|
|||
float scorch = Math.Clamp(pod.Scorch * 0.7f, 0f, 0.55f);
|
||||
Color custom = new(scorch, heat, roleIdx, 1f);
|
||||
|
||||
bool wantsShadow = !hasCam || pos.DistanceSquaredTo(camPos) <= 65f * 65f;
|
||||
bool wantsShadow = !hasCam || pos.DistanceSquaredTo(camPos) <= 160f * 160f;
|
||||
_partPool.Submit(podTpl.CoreMesh, in podXf, in custom, wantsShadow);
|
||||
|
||||
for (int p = 0; p < 4; p++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue