new logo, AO and vsync console commands, GI test area

This commit is contained in:
2022-07-01 15:51:10 +03:00
parent 91df324cf1
commit 9cc8e81b33
14 changed files with 1717 additions and 1545 deletions

2
.gitignore vendored
View File

@@ -21,3 +21,5 @@ packages/*
Tests/bin/ Tests/bin/
Tests/obj/ Tests/obj/
Assets/desktop.ini Assets/desktop.ini
Assets/Maps/autosave/
Demos/

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -49,13 +49,13 @@
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef", "ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"Transform": { "Transform": {
"Translation": { "Translation": {
"X": 1489.0, "X": 990.0,
"Y": 814.0, "Y": 565.0,
"Z": 0.0 "Z": 0.0
} }
}, },
"Data": { "Data": {
"Text": "412955 tris\n 898 drawcalls\n120fps" "Text": "2133 tris\n 186 drawcalls\n60fps"
} }
}, },
{ {
@@ -160,6 +160,27 @@
"TypeName": "Game.CrosshairWidget", "TypeName": "Game.CrosshairWidget",
"ParentID": "2fe5467d4e92726e24227cbcbcbd2844", "ParentID": "2fe5467d4e92726e24227cbcbcbd2844",
"V": {} "V": {}
},
{
"ID": "8736d067492170db415102997d187ff7",
"TypeName": "FlaxEngine.DirectionalLight",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "DirectionalLight",
"Transform": {
"Translation": {
"X": -1567.0185546875,
"Y": 592.0887451171875,
"Z": -2397.31787109375
},
"Orientation": {
"X": 0.7106112837791443,
"Y": 0.0,
"Z": 0.0,
"W": 0.7035849094390869
}
},
"Brightness": 14.400001525878907,
"ViewDistance": 1540.0
} }
] ]
} }

Binary file not shown.

View File

@@ -1,4 +1,5 @@
// comment // comment
r_shadows 1 r_shadows 1
r_lighting 0
cl_maxfps 0 cl_maxfps 0

View File

@@ -2,6 +2,7 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using FidelityFX; using FidelityFX;
using FlaxEditor.Content.Settings;
using FlaxEngine; using FlaxEngine;
namespace Game namespace Game
@@ -202,7 +203,25 @@ namespace Game
boolValue = valueFloat != 0f; boolValue = valueFloat != 0f;
AssetManager.Globals.SetValue("Scene Lighting", boolValue); AssetManager.Globals.SetValue("Scene Lighting", boolValue);
AmbientOcclusion = value;
GlobalIllumination = value;
}
}
[ConsoleVariable("r_ambientocclusion")]
public static string AmbientOcclusion
{
get
{
return Graphics.PostProcessSettings.AmbientOcclusion.Enabled ? "1" : "0";
}
set
{
bool boolValue = false;
if (int.TryParse(value, out int intValue))
boolValue = intValue != 0;
else if (float.TryParse(value, out float valueFloat))
boolValue = valueFloat != 0f;
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings; PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
AmbientOcclusionSettings aoSettings = postProcessSettings.AmbientOcclusion; AmbientOcclusionSettings aoSettings = postProcessSettings.AmbientOcclusion;
@@ -214,14 +233,25 @@ namespace Game
aoSettings.Enabled = boolValue; aoSettings.Enabled = boolValue;
postProcessSettings.AmbientOcclusion = aoSettings; postProcessSettings.AmbientOcclusion = aoSettings;
}
}
GlobalIlluminationSettings giSettings = postProcessSettings.GlobalIllumination; [ConsoleVariable("r_vsync")]
giSettings.Mode = boolValue ? GlobalIlluminationMode.DDGI : GlobalIlluminationMode.None; public static string Vsync
postProcessSettings.GlobalIllumination = giSettings; {
get
{
return Graphics.UseVSync ? "1" : "0";
}
set
{
bool boolValue = false;
if (int.TryParse(value, out int intValue))
boolValue = intValue != 0;
else if (float.TryParse(value, out float valueFloat))
boolValue = valueFloat != 0f;
Graphics.PostProcessSettings = postProcessSettings; Graphics.UseVSync = boolValue;
//Graphics.EnableGlobalSDF = boolValue;
} }
} }
@@ -241,11 +271,14 @@ namespace Game
boolValue = valueFloat != 0f; boolValue = valueFloat != 0f;
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings; PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
GlobalIlluminationSettings giSettings = postProcessSettings.GlobalIllumination; GlobalIlluminationSettings giSettings = postProcessSettings.GlobalIllumination;
giSettings.Mode = boolValue ? GlobalIlluminationMode.DDGI : GlobalIlluminationMode.None; giSettings.Mode = boolValue ? GlobalIlluminationMode.DDGI : GlobalIlluminationMode.None;
postProcessSettings.GlobalIllumination = giSettings; postProcessSettings.GlobalIllumination = giSettings;
Graphics.PostProcessSettings = postProcessSettings; Graphics.PostProcessSettings = postProcessSettings;
Graphics.EnableGlobalSDF = boolValue;
} }
} }
@@ -286,6 +319,13 @@ namespace Game
playerActor.GetScript<PlayerMovement>().SetInput(demoPath); playerActor.GetScript<PlayerMovement>().SetInput(demoPath);
} }
private static Action timeDemoUpdate = null;
private static void TimeDemoOnUpdate()
{
if (timeDemoUpdate != null)
timeDemoUpdate();
}
[ConsoleCommand("timedemo")] [ConsoleCommand("timedemo")]
public static void TimeDemoCommand(string[] text) public static void TimeDemoCommand(string[] text)
{ {
@@ -304,21 +344,20 @@ namespace Game
if (File.Exists(demoPath)) if (File.Exists(demoPath))
playerMovement.SetInput(demoPath); playerMovement.SetInput(demoPath);
Action onUpdate = () => {};
//bool lastPlaying = true;
float accumTime = 0f; float accumTime = 0f;
int accumTimes = 0; int accumTimes = 0;
onUpdate = () => timeDemoUpdate = () =>
{ {
if (playerMovement) if (playerMovement)
{ {
var input = playerMovement.input as PlayerInputDemo; var input = playerMovement.input as PlayerInputDemo;
if (input != null) if (input != null)
{ {
if (!input.IsPlaying) if (!input.IsPlaying)
{ {
Console.Print($"demo ended, time: {accumTimes} frames, avg: {(accumTime/(float)accumTimes)*1000.0f}"); Console.Print($"demo ended, time: {accumTimes} frames, avg: {(accumTime/(float)accumTimes)*1000.0f}");
Scripting.Update -= onUpdate; timeDemoUpdate = null;
return; return;
} }
@@ -327,12 +366,12 @@ namespace Game
accumTime += Time.DeltaTime; accumTime += Time.DeltaTime;
accumTimes++; accumTimes++;
//input.IsPlaying
} }
} }
}; };
Scripting.Update += onUpdate; Scripting.Update -= TimeDemoOnUpdate;
Scripting.Update += TimeDemoOnUpdate;
} }
[ConsoleSubsystemInitializer] [ConsoleSubsystemInitializer]

View File

@@ -387,7 +387,7 @@ namespace Game
rootActor.Orientation = or1; rootActor.Orientation = or1;
cameraHolder.Orientation = or2; cameraHolder.Orientation = or2;
Console.Print(angles.X.ToString()); //Console.Print(angles.X.ToString());
viewAngles = new Float3(angles.Y, angles.X, angles.Z); viewAngles = new Float3(angles.Y, angles.X, angles.Z);
} }