Compare commits
10 Commits
cd66d00219
...
269e8963e8
| Author | SHA1 | Date | |
|---|---|---|---|
| 269e8963e8 | |||
|
|
d24bd7dfd0 | ||
| 2c8c9b1637 | |||
|
|
05a8c841da | ||
|
|
c4fcaa999c | ||
|
|
70c9dd6608 | ||
|
|
802e2ac7c2 | ||
|
|
0ca60062d9 | ||
|
|
22515c37b5 | ||
|
|
38a48cf1d4 |
BIN
Content/Shaders/ColorGrading.flax
(Stored with Git LFS)
BIN
Content/Shaders/ColorGrading.flax
(Stored with Git LFS)
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
"Major": 1,
|
"Major": 1,
|
||||||
"Minor": 11,
|
"Minor": 11,
|
||||||
"Revision": 0,
|
"Revision": 0,
|
||||||
"Build": 6801
|
"Build": 6802
|
||||||
},
|
},
|
||||||
"Company": "Flax",
|
"Company": "Flax",
|
||||||
"Copyright": "Copyright (c) 2012-2025 Wojciech Figat. All rights reserved.",
|
"Copyright": "Copyright (c) 2012-2025 Wojciech Figat. All rights reserved.",
|
||||||
|
|||||||
@@ -130,6 +130,11 @@ namespace FlaxEditor.Content
|
|||||||
eyeAdaptation.Mode = EyeAdaptationMode.None;
|
eyeAdaptation.Mode = EyeAdaptationMode.None;
|
||||||
eyeAdaptation.OverrideFlags |= EyeAdaptationSettingsOverride.Mode;
|
eyeAdaptation.OverrideFlags |= EyeAdaptationSettingsOverride.Mode;
|
||||||
preview.PostFxVolume.EyeAdaptation = eyeAdaptation;
|
preview.PostFxVolume.EyeAdaptation = eyeAdaptation;
|
||||||
|
|
||||||
|
var antiAliasing = preview.PostFxVolume.AntiAliasing;
|
||||||
|
antiAliasing.Mode = AntialiasingMode.FastApproximateAntialiasing;
|
||||||
|
antiAliasing.OverrideFlags |= AntiAliasingSettingsOverride.Mode;
|
||||||
|
preview.PostFxVolume.AntiAliasing = antiAliasing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,11 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
|||||||
var codeEditing = Editor.Instance.CodeEditing;
|
var codeEditing = Editor.Instance.CodeEditing;
|
||||||
var vsCode = codeEditing.GetInBuildEditor(CodeEditorTypes.VSCode);
|
var vsCode = codeEditing.GetInBuildEditor(CodeEditorTypes.VSCode);
|
||||||
var rider = codeEditing.GetInBuildEditor(CodeEditorTypes.Rider);
|
var rider = codeEditing.GetInBuildEditor(CodeEditorTypes.Rider);
|
||||||
|
var zed = codeEditing.GetInBuildEditor(CodeEditorTypes.Zed);
|
||||||
|
|
||||||
#if PLATFORM_WINDOW
|
#if PLATFORM_WINDOW
|
||||||
// Favor the newest Visual Studio
|
// Favor the newest Visual Studio
|
||||||
for (int i = (int)CodeEditorTypes.VS2019; i >= (int)CodeEditorTypes.VS2008; i--)
|
for (int i = (int)CodeEditorTypes.VS2026; i >= (int)CodeEditorTypes.VS2008; i--)
|
||||||
{
|
{
|
||||||
var visualStudio = codeEditing.GetInBuildEditor((CodeEditorTypes)i);
|
var visualStudio = codeEditing.GetInBuildEditor((CodeEditorTypes)i);
|
||||||
if (visualStudio != null)
|
if (visualStudio != null)
|
||||||
@@ -66,6 +67,8 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
|||||||
_currentEditor = vsCode;
|
_currentEditor = vsCode;
|
||||||
else if (rider != null)
|
else if (rider != null)
|
||||||
_currentEditor = rider;
|
_currentEditor = rider;
|
||||||
|
else if (zed != null)
|
||||||
|
_currentEditor = zed;
|
||||||
else
|
else
|
||||||
_currentEditor = codeEditing.GetInBuildEditor(CodeEditorTypes.SystemDefault);
|
_currentEditor = codeEditing.GetInBuildEditor(CodeEditorTypes.SystemDefault);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
|||||||
case CodeEditorTypes.Rider:
|
case CodeEditorTypes.Rider:
|
||||||
Name = "Rider";
|
Name = "Rider";
|
||||||
break;
|
break;
|
||||||
|
case CodeEditorTypes.Zed:
|
||||||
|
Name = "Zed";
|
||||||
|
break;
|
||||||
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,6 +86,7 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
|||||||
case CodeEditorTypes.VSCodeInsiders:
|
case CodeEditorTypes.VSCodeInsiders:
|
||||||
case CodeEditorTypes.VSCode: return "-vscode -vs2022";
|
case CodeEditorTypes.VSCode: return "-vscode -vs2022";
|
||||||
case CodeEditorTypes.Rider: return "-vs2022";
|
case CodeEditorTypes.Rider: return "-vs2022";
|
||||||
|
case CodeEditorTypes.Zed: return "-vs2022";
|
||||||
default: return null;
|
default: return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "ScriptsBuilder.h"
|
#include "ScriptsBuilder.h"
|
||||||
#include "CodeEditors/VisualStudioCodeEditor.h"
|
#include "CodeEditors/VisualStudioCodeEditor.h"
|
||||||
#include "CodeEditors/RiderCodeEditor.h"
|
#include "CodeEditors/RiderCodeEditor.h"
|
||||||
|
#include "CodeEditors/ZedEditor.h"
|
||||||
#if USE_VISUAL_STUDIO_DTE
|
#if USE_VISUAL_STUDIO_DTE
|
||||||
#include "CodeEditors/VisualStudio/VisualStudioEditor.h"
|
#include "CodeEditors/VisualStudio/VisualStudioEditor.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -241,6 +242,7 @@ bool CodeEditingManagerService::Init()
|
|||||||
#endif
|
#endif
|
||||||
VisualStudioCodeEditor::FindEditors(&CodeEditors);
|
VisualStudioCodeEditor::FindEditors(&CodeEditors);
|
||||||
RiderCodeEditor::FindEditors(&CodeEditors);
|
RiderCodeEditor::FindEditors(&CodeEditors);
|
||||||
|
ZedEditor::FindEditors(&CodeEditors);
|
||||||
CodeEditors.Add(New<SystemDefaultCodeEditor>());
|
CodeEditors.Add(New<SystemDefaultCodeEditor>());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ API_ENUM(Namespace="FlaxEditor", Attributes="HideInEditor") enum class CodeEdito
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
VSCodeInsiders,
|
VSCodeInsiders,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Zed
|
||||||
|
/// </summary>
|
||||||
|
Zed,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rider
|
/// Rider
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
171
Source/Editor/Scripting/CodeEditors/ZedEditor.cpp
Normal file
171
Source/Editor/Scripting/CodeEditors/ZedEditor.cpp
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
#include "ZedEditor.h"
|
||||||
|
#include "Engine/Platform/FileSystem.h"
|
||||||
|
#include "Engine/Platform/CreateProcessSettings.h"
|
||||||
|
#include "Engine/Core/Log.h"
|
||||||
|
#include "Editor/Editor.h"
|
||||||
|
#include "Editor/ProjectInfo.h"
|
||||||
|
#include "Editor/Scripting/ScriptsBuilder.h"
|
||||||
|
#include "Engine/Engine/Globals.h"
|
||||||
|
#if PLATFORM_LINUX
|
||||||
|
#include <stdio.h>
|
||||||
|
#elif PLATFORM_WINDOWS
|
||||||
|
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
|
||||||
|
#elif PLATFORM_MAC
|
||||||
|
#include "Engine/Platform/Apple/AppleUtils.h"
|
||||||
|
#include <AppKit/AppKit.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ZedEditor::ZedEditor(const String& execPath)
|
||||||
|
: _execPath(execPath)
|
||||||
|
, _workspacePath(Globals::ProjectFolder)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZedEditor::FindEditors(Array<CodeEditor*>* output)
|
||||||
|
{
|
||||||
|
#if PLATFORM_WINDOWS
|
||||||
|
String cmd;
|
||||||
|
if (Platform::ReadRegValue(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Classes\\Applications\\Zed.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
|
||||||
|
{
|
||||||
|
if (Platform::ReadRegValue(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Classes\\Applications\\Zed.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
|
||||||
|
{
|
||||||
|
// No hits in registry, try default path instead
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String path;
|
||||||
|
if (cmd.IsEmpty())
|
||||||
|
{
|
||||||
|
path = cmd.Substring(1, cmd.Length() - String(TEXT("\" \"%1\"")).Length() - 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
String localAppDataPath;
|
||||||
|
FileSystem::GetSpecialFolderPath(SpecialFolder::LocalAppData, localAppDataPath);
|
||||||
|
path = localAppDataPath / TEXT("Programs/Zed/Zed.exe");
|
||||||
|
}
|
||||||
|
if (FileSystem::FileExists(path))
|
||||||
|
{
|
||||||
|
output->Add(New<ZedEditor>(path));
|
||||||
|
}
|
||||||
|
#elif PLATFORM_LINUX
|
||||||
|
char buffer[128];
|
||||||
|
FILE* pipe = popen("/bin/bash -c \"type -p code\"", "r");
|
||||||
|
if (pipe)
|
||||||
|
{
|
||||||
|
StringAnsi pathAnsi;
|
||||||
|
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
|
||||||
|
pathAnsi += buffer;
|
||||||
|
pclose(pipe);
|
||||||
|
const String path(pathAnsi.Get(), pathAnsi.Length() != 0 ? pathAnsi.Length() - 1 : 0);
|
||||||
|
if (FileSystem::FileExists(path))
|
||||||
|
{
|
||||||
|
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const String path(TEXT("/usr/bin/code"));
|
||||||
|
if (FileSystem::FileExists(path))
|
||||||
|
{
|
||||||
|
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect Flatpak installations
|
||||||
|
{
|
||||||
|
CreateProcessSettings procSettings;
|
||||||
|
procSettings.FileName = TEXT("/bin/bash -c \"flatpak list --app --columns=application | grep com.visualstudio.code -c\"");
|
||||||
|
procSettings.HiddenWindow = true;
|
||||||
|
if (Platform::CreateProcess(procSettings) == 0)
|
||||||
|
{
|
||||||
|
const String runPath(TEXT("flatpak run com.visualstudio.code"));
|
||||||
|
output->Add(New<VisualStudioCodeEditor>(runPath, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif PLATFORM_MAC
|
||||||
|
// System installed app
|
||||||
|
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"com.microsoft.VSCode"];
|
||||||
|
if (AppURL != nullptr)
|
||||||
|
{
|
||||||
|
const String path = AppleUtils::ToString((CFStringRef)[AppURL path]);
|
||||||
|
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Predefined locations
|
||||||
|
String userFolder;
|
||||||
|
FileSystem::GetSpecialFolderPath(SpecialFolder::Documents, userFolder);
|
||||||
|
String paths[3] =
|
||||||
|
{
|
||||||
|
TEXT("/Applications/Visual Studio Code.app"),
|
||||||
|
userFolder + TEXT("/../Visual Studio Code.app"),
|
||||||
|
userFolder + TEXT("/../Downloads/Visual Studio Code.app"),
|
||||||
|
};
|
||||||
|
for (const String& path : paths)
|
||||||
|
{
|
||||||
|
if (FileSystem::DirectoryExists(path))
|
||||||
|
{
|
||||||
|
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeEditorTypes ZedEditor::GetType() const
|
||||||
|
{
|
||||||
|
return CodeEditorTypes::Zed;
|
||||||
|
}
|
||||||
|
|
||||||
|
String ZedEditor::GetName() const
|
||||||
|
{
|
||||||
|
return TEXT("Zed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZedEditor::OpenFile(const String& path, int32 line)
|
||||||
|
{
|
||||||
|
// Generate VS solution files for intellisense
|
||||||
|
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
|
||||||
|
{
|
||||||
|
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open file
|
||||||
|
line = line > 0 ? line : 1;
|
||||||
|
CreateProcessSettings procSettings;
|
||||||
|
procSettings.FileName = _execPath;
|
||||||
|
procSettings.Arguments = String::Format(TEXT("\"{0}\" \"{1}:{2}\""), _workspacePath, path, line);
|
||||||
|
procSettings.HiddenWindow = false;
|
||||||
|
procSettings.WaitForEnd = false;
|
||||||
|
procSettings.LogOutput = false;
|
||||||
|
procSettings.ShellExecute = true;
|
||||||
|
Platform::CreateProcess(procSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZedEditor::OpenSolution()
|
||||||
|
{
|
||||||
|
// Generate VS solution files for intellisense
|
||||||
|
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
|
||||||
|
{
|
||||||
|
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open solution
|
||||||
|
CreateProcessSettings procSettings;
|
||||||
|
procSettings.FileName = _execPath;
|
||||||
|
procSettings.Arguments = String::Format(TEXT("\"{0}\""), _workspacePath);
|
||||||
|
procSettings.HiddenWindow = false;
|
||||||
|
procSettings.WaitForEnd = false;
|
||||||
|
procSettings.LogOutput = false;
|
||||||
|
procSettings.ShellExecute = true;
|
||||||
|
Platform::CreateProcess(procSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZedEditor::UseAsyncForOpen() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
41
Source/Editor/Scripting/CodeEditors/ZedEditor.h
Normal file
41
Source/Editor/Scripting/CodeEditors/ZedEditor.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Editor/Scripting/CodeEditor.h"
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Implementation of code editor utility that is using Microsoft Visual Studio Code.
|
||||||
|
/// </summary>
|
||||||
|
class ZedEditor : public CodeEditor
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
String _execPath;
|
||||||
|
String _workspacePath;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="VisualStudioEditor"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="execPath">Executable file path</param>
|
||||||
|
ZedEditor(const String& execPath);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tries to find installed Visual Studio Code instance. Adds them to the result list.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="output">The output editors.</param>
|
||||||
|
static void FindEditors(Array<CodeEditor*>* output);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// [CodeEditor]
|
||||||
|
CodeEditorTypes GetType() const override;
|
||||||
|
String GetName() const override;
|
||||||
|
void OpenFile(const String& path, int32 line) override;
|
||||||
|
void OpenSolution() override;
|
||||||
|
bool UseAsyncForOpen() const override;
|
||||||
|
};
|
||||||
@@ -491,7 +491,7 @@ void GPUContextDX12::flushUAVs()
|
|||||||
ASSERT(uaCount <= GPU_MAX_UA_BINDED);
|
ASSERT(uaCount <= GPU_MAX_UA_BINDED);
|
||||||
|
|
||||||
// Fill table with source descriptors
|
// Fill table with source descriptors
|
||||||
DxShaderHeader& header = _currentCompute ? ((GPUShaderProgramCSDX12*)_currentCompute)->Header : _currentState->Header;
|
DxShaderHeader& header = _isCompute ? ((GPUShaderProgramCSDX12*)_currentCompute)->Header : _currentState->Header;
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE srcDescriptorRangeStarts[GPU_MAX_UA_BINDED];
|
D3D12_CPU_DESCRIPTOR_HANDLE srcDescriptorRangeStarts[GPU_MAX_UA_BINDED];
|
||||||
for (uint32 i = 0; i < uaCount; i++)
|
for (uint32 i = 0; i < uaCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1969,6 +1969,7 @@ void PhysicsBackend::EndSimulateScene(void* scene)
|
|||||||
scenePhysX->EventsCallback.SendTriggerEvents();
|
scenePhysX->EventsCallback.SendTriggerEvents();
|
||||||
scenePhysX->EventsCallback.SendCollisionEvents();
|
scenePhysX->EventsCallback.SendCollisionEvents();
|
||||||
scenePhysX->EventsCallback.SendJointEvents();
|
scenePhysX->EventsCallback.SendJointEvents();
|
||||||
|
scenePhysX->EventsCallback.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear delta after simulation ended
|
// Clear delta after simulation ended
|
||||||
@@ -4466,14 +4467,14 @@ void PhysicsBackend::FlushRequests(void* scene)
|
|||||||
}
|
}
|
||||||
if (scenePhysX->RemoveColliders.HasItems())
|
if (scenePhysX->RemoveColliders.HasItems())
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < scenePhysX->RemoveColliders.Count(); i++)
|
for (PhysicsColliderActor* e : scenePhysX->RemoveColliders)
|
||||||
scenePhysX->EventsCallback.OnColliderRemoved(scenePhysX->RemoveColliders[i]);
|
scenePhysX->EventsCallback.OnColliderRemoved(e);
|
||||||
scenePhysX->RemoveColliders.Clear();
|
scenePhysX->RemoveColliders.Clear();
|
||||||
}
|
}
|
||||||
if (scenePhysX->RemoveJoints.HasItems())
|
if (scenePhysX->RemoveJoints.HasItems())
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < scenePhysX->RemoveJoints.Count(); i++)
|
for (Joint* e : scenePhysX->RemoveJoints)
|
||||||
scenePhysX->EventsCallback.OnJointRemoved(scenePhysX->RemoveJoints[i]);
|
scenePhysX->EventsCallback.OnJointRemoved(e);
|
||||||
scenePhysX->RemoveJoints.Clear();
|
scenePhysX->RemoveJoints.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ public:
|
|||||||
Data CachedData;
|
Data CachedData;
|
||||||
ToneMappingMode Mode = ToneMappingMode::None;
|
ToneMappingMode Mode = ToneMappingMode::None;
|
||||||
Texture* LutTexture = nullptr;
|
Texture* LutTexture = nullptr;
|
||||||
|
#if COMPILE_WITH_DEV_ENV
|
||||||
|
uint64 FrameRendered = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
~ColorGradingCustomBuffer()
|
~ColorGradingCustomBuffer()
|
||||||
{
|
{
|
||||||
@@ -54,6 +57,17 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if COMPILE_WITH_DEV_ENV
|
||||||
|
|
||||||
|
void ColorGradingPass::OnShaderReloading(Asset* obj)
|
||||||
|
{
|
||||||
|
_psLut.Release();
|
||||||
|
invalidateResources();
|
||||||
|
_reloadedFrame = Engine::FrameCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
String ColorGradingPass::ToString() const
|
String ColorGradingPass::ToString() const
|
||||||
{
|
{
|
||||||
return TEXT("ColorGradingPass");
|
return TEXT("ColorGradingPass");
|
||||||
@@ -194,6 +208,9 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
|
|||||||
// Check if LUT parameter hasn't been changed since the last time
|
// Check if LUT parameter hasn't been changed since the last time
|
||||||
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
|
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
|
||||||
colorGradingBuffer.Mode == toneMapping.Mode &&
|
colorGradingBuffer.Mode == toneMapping.Mode &&
|
||||||
|
#if COMPILE_WITH_DEV_ENV
|
||||||
|
colorGradingBuffer.FrameRendered > _reloadedFrame &&
|
||||||
|
#endif
|
||||||
Engine::FrameCount > 30 && // Skip caching when engine is starting TODO: find why this hack is needed
|
Engine::FrameCount > 30 && // Skip caching when engine is starting TODO: find why this hack is needed
|
||||||
colorGradingBuffer.LutTexture == lutTexture)
|
colorGradingBuffer.LutTexture == lutTexture)
|
||||||
{
|
{
|
||||||
@@ -203,6 +220,9 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
|
|||||||
colorGradingBuffer.CachedData = data;
|
colorGradingBuffer.CachedData = data;
|
||||||
colorGradingBuffer.Mode = toneMapping.Mode;
|
colorGradingBuffer.Mode = toneMapping.Mode;
|
||||||
colorGradingBuffer.LutTexture = lutTexture;
|
colorGradingBuffer.LutTexture = lutTexture;
|
||||||
|
#if COMPILE_WITH_DEV_ENV
|
||||||
|
colorGradingBuffer.FrameRendered = Engine::FrameCount;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Render LUT
|
// Render LUT
|
||||||
PROFILE_GPU("Color Grading LUT");
|
PROFILE_GPU("Color Grading LUT");
|
||||||
|
|||||||
@@ -25,11 +25,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
#if COMPILE_WITH_DEV_ENV
|
#if COMPILE_WITH_DEV_ENV
|
||||||
void OnShaderReloading(Asset* obj)
|
uint64 _reloadedFrame = 0;
|
||||||
{
|
void OnShaderReloading(Asset* obj);
|
||||||
_psLut.Release();
|
|
||||||
invalidateResources();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ void EyeAdaptationPass::Render(RenderContext& renderContext, GPUTexture* colorBu
|
|||||||
if (mode == EyeAdaptationMode::Manual)
|
if (mode == EyeAdaptationMode::Manual)
|
||||||
{
|
{
|
||||||
// Apply fixed manual exposure
|
// Apply fixed manual exposure
|
||||||
|
context->ResetSR();
|
||||||
context->SetRenderTarget(*colorBuffer);
|
context->SetRenderTarget(*colorBuffer);
|
||||||
context->SetViewportAndScissors((float)colorBuffer->Width(), (float)colorBuffer->Height());
|
context->SetViewportAndScissors((float)colorBuffer->Width(), (float)colorBuffer->Height());
|
||||||
context->SetState(_psManual);
|
context->SetState(_psManual);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class Scripting : EngineModule
|
|||||||
options.ScriptingAPI.Defines.Add("NET");
|
options.ScriptingAPI.Defines.Add("NET");
|
||||||
AddFrameworkDefines("NET{0}_{1}", dotnetSdk.Version.Major, 0); // "NET7_0"
|
AddFrameworkDefines("NET{0}_{1}", dotnetSdk.Version.Major, 0); // "NET7_0"
|
||||||
for (int i = 5; i <= dotnetSdk.Version.Major; i++)
|
for (int i = 5; i <= dotnetSdk.Version.Major; i++)
|
||||||
AddFrameworkDefines("NET{0}_{1}_OR_GREATER", dotnetSdk.Version.Major, 0); // "NET7_0_OR_GREATER"
|
AddFrameworkDefines("NET{0}_{1}_OR_GREATER", i, 0); // "NET7_0_OR_GREATER"
|
||||||
options.ScriptingAPI.Defines.Add("NETCOREAPP");
|
options.ScriptingAPI.Defines.Add("NETCOREAPP");
|
||||||
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 3, 1); // "NETCOREAPP3_1_OR_GREATER"
|
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 3, 1); // "NETCOREAPP3_1_OR_GREATER"
|
||||||
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 2, 2);
|
AddFrameworkDefines("NETCOREAPP{0}_{1}_OR_GREATER", 2, 2);
|
||||||
|
|||||||
@@ -65,6 +65,8 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef MessageBox
|
||||||
|
|
||||||
static void stbWrite(void* context, void* data, int size)
|
static void stbWrite(void* context, void* data, int size)
|
||||||
{
|
{
|
||||||
auto file = (FileWriteStream*)context;
|
auto file = (FileWriteStream*)context;
|
||||||
|
|||||||
@@ -164,16 +164,14 @@ float3 TonemapACES(float3 linearColor)
|
|||||||
// The code was originally written by Stephen Hill (@self_shadow).
|
// The code was originally written by Stephen Hill (@self_shadow).
|
||||||
|
|
||||||
// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
|
// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
|
||||||
static const float3x3 ACESInputMat =
|
static const float3x3 ACESInputMat = {
|
||||||
{
|
|
||||||
{0.59719, 0.35458, 0.04823},
|
{0.59719, 0.35458, 0.04823},
|
||||||
{0.07600, 0.90834, 0.01566},
|
{0.07600, 0.90834, 0.01566},
|
||||||
{0.02840, 0.13383, 0.83777}
|
{0.02840, 0.13383, 0.83777}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ODT_SAT => XYZ => D60_2_D65 => sRGB
|
// ODT_SAT => XYZ => D60_2_D65 => sRGB
|
||||||
static const float3x3 ACESOutputMat =
|
static const float3x3 ACESOutputMat = {
|
||||||
{
|
|
||||||
{ 1.60475, -0.53108, -0.07367},
|
{ 1.60475, -0.53108, -0.07367},
|
||||||
{-0.10208, 1.10813, -0.00605},
|
{-0.10208, 1.10813, -0.00605},
|
||||||
{-0.00327, -0.07276, 1.07602}
|
{-0.00327, -0.07276, 1.07602}
|
||||||
@@ -188,6 +186,7 @@ float3 TonemapACES(float3 linearColor)
|
|||||||
color = a / b;
|
color = a / b;
|
||||||
|
|
||||||
color = mul(ACESOutputMat, color);
|
color = mul(ACESOutputMat, color);
|
||||||
|
|
||||||
return saturate(color);
|
return saturate(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ float4 FastTonemapInvert(float4 c)
|
|||||||
return float4(FastTonemapInvert(c.rgb), c.a);
|
return float4(FastTonemapInvert(c.rgb), c.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
float LinearToSrgbChannel(float linearColor)
|
float LinearToSrgb(float linearColor)
|
||||||
{
|
{
|
||||||
if (linearColor < 0.00313067)
|
if (linearColor < 0.00313067)
|
||||||
return linearColor * 12.92;
|
return linearColor * 12.92;
|
||||||
@@ -46,10 +46,7 @@ float LinearToSrgbChannel(float linearColor)
|
|||||||
|
|
||||||
float3 LinearToSrgb(float3 linearColor)
|
float3 LinearToSrgb(float3 linearColor)
|
||||||
{
|
{
|
||||||
return float3(
|
return float3(LinearToSrgb(linearColor.r), LinearToSrgb(linearColor.g), LinearToSrgb(linearColor.b));
|
||||||
LinearToSrgbChannel(linearColor.r),
|
|
||||||
LinearToSrgbChannel(linearColor.g),
|
|
||||||
LinearToSrgbChannel(linearColor.b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float3 sRGBToLinear(float3 color)
|
float3 sRGBToLinear(float3 color)
|
||||||
|
|||||||
4
Source/ThirdParty/detex/detex.h
vendored
4
Source/ThirdParty/detex/detex.h
vendored
@@ -72,7 +72,11 @@ __BEGIN_DECLS
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#define DETEX_INLINE_ONLY __forceinline
|
||||||
|
#else
|
||||||
#define DETEX_INLINE_ONLY __attribute__((always_inline)) inline
|
#define DETEX_INLINE_ONLY __attribute__((always_inline)) inline
|
||||||
|
#endif
|
||||||
#define DETEX_RESTRICT __restrict
|
#define DETEX_RESTRICT __restrict
|
||||||
|
|
||||||
/* Maximum uncompressed block size in bytes. */
|
/* Maximum uncompressed block size in bytes. */
|
||||||
|
|||||||
Reference in New Issue
Block a user