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/obj/
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",
"Transform": {
"Translation": {
"X": 1489.0,
"Y": 814.0,
"X": 990.0,
"Y": 565.0,
"Z": 0.0
}
},
"Data": {
"Text": "412955 tris\n 898 drawcalls\n120fps"
"Text": "2133 tris\n 186 drawcalls\n60fps"
}
},
{
@@ -160,6 +160,27 @@
"TypeName": "Game.CrosshairWidget",
"ParentID": "2fe5467d4e92726e24227cbcbcbd2844",
"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
r_shadows 1
r_lighting 0
cl_maxfps 0

View File

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

View File

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