Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c328d2b559 | |||
| 65747c9ddf |
@@ -1,39 +0,0 @@
|
|||||||
name: Install Vulkan SDK
|
|
||||||
description: Downloads and installs Vulkan SDK.
|
|
||||||
inputs:
|
|
||||||
vulkan-version:
|
|
||||||
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
|
|
||||||
default: '1.2.198.1'
|
|
||||||
required: false
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install Vulkan SDK
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
export VULKAN_SDK_VER=${{ inputs.vulkan-version }}
|
|
||||||
echo VULKAN_SDK_VER=$VULKAN_SDK_VER >> $GITHUB_ENV
|
|
||||||
echo "Downloading Vulkan SDK version $VULKAN_SDK_VER"
|
|
||||||
case `uname -s` in
|
|
||||||
Linux)
|
|
||||||
export VULKAN_SDK_ROOT=`pwd`/../VulkanSDK
|
|
||||||
wget "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/linux/vulkan-sdk.tar.gz" --no-verbose -O vulkan-sdk.tar.gz
|
|
||||||
mkdir $VULKAN_SDK_ROOT
|
|
||||||
tar -xf vulkan-sdk.tar.gz -C $VULKAN_SDK_ROOT
|
|
||||||
export VULKAN_SDK=$VULKAN_SDK_ROOT/$VULKAN_SDK_VER/x86_64
|
|
||||||
;;
|
|
||||||
Darwin)
|
|
||||||
export VULKAN_SDK_ROOT=`pwd`/../VulkanSDK
|
|
||||||
curl -LO "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkan-sdk.dmg"
|
|
||||||
hdiutil attach vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
|
|
||||||
sudo "/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan" --root $VULKAN_SDK_ROOT --accept-licenses --default-answer --confirm-command install
|
|
||||||
export VULKAN_SDK=$VULKAN_SDK_ROOT/macOS
|
|
||||||
;;
|
|
||||||
*) # Windows
|
|
||||||
curl -L -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/VulkanSDK-$VULKAN_SDK_VER-Installer.exe
|
|
||||||
./vulkan-sdk.exe --root "C:\VulkanSDK" --accept-licenses --default-answer --confirm-command install
|
|
||||||
export VULKAN_SDK="C:\VulkanSDK"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo VULKAN_SDK=$VULKAN_SDK >> $GITHUB_ENV
|
|
||||||
echo "Vulkan SDK installed to $VULKAN_SDK"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
name: Build Android
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Game
|
|
||||||
game-windows:
|
|
||||||
name: Game (Android, Release ARM64)
|
|
||||||
runs-on: "windows-2019"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
|
|
||||||
@@ -10,18 +10,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Checkout LFS
|
||||||
|
run: |
|
||||||
|
git lfs version
|
||||||
|
git lfs pull
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo rm -f /etc/apt/sources.list.d/*
|
sudo rm -f /etc/apt/sources.list.d/*
|
||||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
|
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
|
||||||
@@ -31,13 +29,11 @@ jobs:
|
|||||||
name: Game (Linux, Release x64)
|
name: Game (Linux, Release x64)
|
||||||
runs-on: "ubuntu-20.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev
|
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev
|
||||||
- name: Setup Vulkan
|
- name: Checkout repo
|
||||||
uses: ./.github/actions/vulkan
|
uses: actions/checkout@v2
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Build macOS
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Editor
|
|
||||||
editor-mac:
|
|
||||||
name: Editor (Mac, Development x64)
|
|
||||||
runs-on: "macos-latest"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -arch=x64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
|
||||||
|
|
||||||
# Game
|
|
||||||
game-mac:
|
|
||||||
name: Game (Mac, Release x64)
|
|
||||||
runs-on: "macos-latest"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -arch=x64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
|
|
||||||
@@ -6,12 +6,10 @@ jobs:
|
|||||||
# Editor
|
# Editor
|
||||||
editor-windows:
|
editor-windows:
|
||||||
name: Editor (Windows, Development x64)
|
name: Editor (Windows, Development x64)
|
||||||
runs-on: "windows-2019"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
@@ -23,12 +21,10 @@ jobs:
|
|||||||
# Game
|
# Game
|
||||||
game-windows:
|
game-windows:
|
||||||
name: Game (Windows, Release x64)
|
name: Game (Windows, Release x64)
|
||||||
runs-on: "windows-2019"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
# Windows
|
# Windows
|
||||||
package-windows-editor:
|
package-windows-editor:
|
||||||
name: Editor (Windows)
|
name: Editor (Windows)
|
||||||
runs-on: "windows-2019"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -17,8 +17,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output
|
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||||
@@ -34,7 +32,7 @@ jobs:
|
|||||||
path: Output/EditorDebugSymbols.zip
|
path: Output/EditorDebugSymbols.zip
|
||||||
package-windows-game:
|
package-windows-game:
|
||||||
name: Game (Windows)
|
name: Game (Windows)
|
||||||
runs-on: "windows-2019"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -42,8 +40,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output
|
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||||
@@ -70,8 +66,6 @@ jobs:
|
|||||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output
|
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||||
@@ -96,8 +90,6 @@ jobs:
|
|||||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output
|
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||||
@@ -106,45 +98,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Linux-Game
|
name: Linux-Game
|
||||||
path: Output/Linux.zip
|
path: Output/Linux.zip
|
||||||
|
|
||||||
# Mac
|
|
||||||
package-mac-editor:
|
|
||||||
name: Editor (Mac)
|
|
||||||
runs-on: "macos-latest"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./PackageEditor.command -arch=x64 -platform=Mac -deployOutput=Output
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: Mac-Editor
|
|
||||||
path: Output/FlaxEditorMac.zip
|
|
||||||
package-mac-game:
|
|
||||||
name: Game (Mac)
|
|
||||||
runs-on: "macos-latest"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./PackagePlatforms.command -arch=x64 -platform=Mac -deployOutput=Output
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: Mac-Game
|
|
||||||
path: Output/Mac.zip
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Tests
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Tests
|
|
||||||
tests-linux:
|
|
||||||
name: Tests (Linux)
|
|
||||||
runs-on: "ubuntu-20.04"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo rm -f /etc/apt/sources.list.d/*
|
|
||||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./GenerateProjectFiles.sh -vs2019
|
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget
|
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets=FlaxEditor -BuildBindingsOnly
|
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets="FlaxEngine.Tests"
|
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Debug -buildtargets="Flax.Build.Tests"
|
|
||||||
- name: Test
|
|
||||||
run: |
|
|
||||||
Binaries/Editor/Linux/Development/FlaxTests
|
|
||||||
mono Source/Platforms/DotNet/NUnit/nunit3-console.exe Binaries/Tools/FlaxEngine.Tests.dll --framework=mono-4.0
|
|
||||||
mono Source/Platforms/DotNet/NUnit/nunit3-console.exe Binaries/Tools/Flax.Build.Tests.dll --framework=mono-4.0
|
|
||||||
- name: Test UseLargeWorlds
|
|
||||||
run: |
|
|
||||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
|
|
||||||
Binaries/Editor/Linux/Development/FlaxTests
|
|
||||||
@@ -10,8 +10,6 @@ Source/*.csproj
|
|||||||
/Package_*/
|
/Package_*/
|
||||||
!Source/Engine/Debug
|
!Source/Engine/Debug
|
||||||
/Source/Platforms/Editor/Linux/Mono/etc/mono/registry
|
/Source/Platforms/Editor/Linux/Mono/etc/mono/registry
|
||||||
PackageEditor_Cert.bat
|
|
||||||
PackagePlatforms_Cert.bat
|
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
@@ -21,8 +19,6 @@ PackagePlatforms_Cert.bat
|
|||||||
*.tlog
|
*.tlog
|
||||||
*.lastbuilddate
|
*.lastbuilddate
|
||||||
*.opendb
|
*.opendb
|
||||||
*.DS_Store
|
|
||||||
*.xcodeproj
|
|
||||||
|
|
||||||
# NUNIT
|
# NUNIT
|
||||||
*.VisualState.xml
|
*.VisualState.xml
|
||||||
@@ -150,6 +146,5 @@ bin/
|
|||||||
obj/
|
obj/
|
||||||
*.vcxproj.filters
|
*.vcxproj.filters
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
||||||
|
|||||||
@@ -38,12 +38,6 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
|
|||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
## Contribution
|
|
||||||
|
|
||||||
Using Flax source code is strictly governed by the Flax Engine End User License Agreement. If you don't agree to those terms, as amended from time to time, you are not permitted to access or use Flax Engine.
|
|
||||||
|
|
||||||
We welcome any contributions to Flax Engine development through pull requests on GitHub. Most of our active development is in the master branch, so we prefer to take pull requests there (particularly for new features). We try to make sure that all new code adheres to the Flax coding standards. All contributions are governed by the terms of the [EULA](https://flaxengine.com/licensing/).
|
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -374,18 +374,4 @@ void PS_Depth(PixelInput input)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _PS_QuadOverdraw
|
|
||||||
|
|
||||||
#include "./Flax/Editor/QuadOverdraw.hlsl"
|
|
||||||
|
|
||||||
// Pixel Shader function for Quad Overdraw Pass (editor-only)
|
|
||||||
[earlydepthstencil]
|
|
||||||
META_PS(USE_EDITOR, FEATURE_LEVEL_SM5)
|
|
||||||
void PS_QuadOverdraw(float4 svPos : SV_Position, uint primId : SV_PrimitiveID)
|
|
||||||
{
|
|
||||||
DoQuadOverdraw(svPos, primId);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@9
|
@9
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ void PS_GBuffer(
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Light = float4(0, 0, 0, 1);
|
Light = 0;
|
||||||
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
// LOD masking
|
// LOD masking
|
||||||
|
|||||||
@@ -6,10 +6,6 @@
|
|||||||
#include "./Flax/LightingCommon.hlsl"
|
#include "./Flax/LightingCommon.hlsl"
|
||||||
#if USE_REFLECTIONS
|
#if USE_REFLECTIONS
|
||||||
#include "./Flax/ReflectionsCommon.hlsl"
|
#include "./Flax/ReflectionsCommon.hlsl"
|
||||||
#define MATERIAL_REFLECTIONS_SSR 1
|
|
||||||
#if MATERIAL_REFLECTIONS == MATERIAL_REFLECTIONS_SSR
|
|
||||||
#include "./Flax/SSR.hlsl"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#include "./Flax/Lighting.hlsl"
|
#include "./Flax/Lighting.hlsl"
|
||||||
#include "./Flax/ShadowsSampling.hlsl"
|
#include "./Flax/ShadowsSampling.hlsl"
|
||||||
@@ -97,34 +93,9 @@ float4 PS_Forward(PixelInput input) : SV_Target0
|
|||||||
light += GetLighting(ViewPos, localLight, gBuffer, shadowMask, true, isSpotLight);
|
light += GetLighting(ViewPos, localLight, gBuffer, shadowMask, true, isSpotLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate lighting from Global Illumination
|
|
||||||
#if USE_GI
|
|
||||||
light += GetGlobalIlluminationLighting(gBuffer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Calculate reflections
|
|
||||||
#if USE_REFLECTIONS
|
#if USE_REFLECTIONS
|
||||||
float3 reflections = SampleReflectionProbe(ViewPos, EnvProbe, EnvironmentProbe, gBuffer.WorldPos, gBuffer.Normal, gBuffer.Roughness).rgb;
|
// Calculate reflections
|
||||||
|
light.rgb += GetEnvProbeLighting(ViewPos, EnvProbe, EnvironmentProbe, gBuffer) * light.a;
|
||||||
#if MATERIAL_REFLECTIONS == MATERIAL_REFLECTIONS_SSR
|
|
||||||
// Screen Space Reflections
|
|
||||||
Texture2D sceneDepthTexture = MATERIAL_REFLECTIONS_SSR_DEPTH; // Material Generator inserts depth and color buffers and plugs it via internal define
|
|
||||||
Texture2D sceneColorTexture = MATERIAL_REFLECTIONS_SSR_COLOR;
|
|
||||||
float2 screenUV = materialInput.SvPosition.xy * ScreenSize.zw;
|
|
||||||
float stepSize = ScreenSize.z; // 1 / screenWidth
|
|
||||||
float maxSamples = 48;
|
|
||||||
float worldAntiSelfOcclusionBias = 0.1f;
|
|
||||||
float brdfBias = 0.82f;
|
|
||||||
float drawDistance = 5000.0f;
|
|
||||||
float3 hit = TraceScreenSpaceReflection(screenUV, gBuffer, sceneDepthTexture, ViewPos, ViewMatrix, ViewProjectionMatrix, stepSize, maxSamples, false, 0.0f, worldAntiSelfOcclusionBias, brdfBias, drawDistance);
|
|
||||||
if (hit.z > 0)
|
|
||||||
{
|
|
||||||
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
|
|
||||||
reflections = lerp(reflections, screenColor, hit.z);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
light.rgb += reflections * GetReflectionSpecularLighting(ViewPos, gBuffer) * light.a;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add lighting (apply ambient occlusion)
|
// Add lighting (apply ambient occlusion)
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
|
||||||
|
|
||||||
@0// Global Illumination: Defines
|
|
||||||
#define USE_GI 1
|
|
||||||
@1// Global Illumination: Includes
|
|
||||||
#include "./Flax/GI/DDGI.hlsl"
|
|
||||||
#include "./Flax/LightingCommon.hlsl"
|
|
||||||
@2// Global Illumination: Constants
|
|
||||||
DDGIData DDGI;
|
|
||||||
@3// Global Illumination: Resources
|
|
||||||
Texture2D<snorm float4> ProbesState : register(t__SRV__);
|
|
||||||
Texture2D<float4> ProbesDistance : register(t__SRV__);
|
|
||||||
Texture2D<float4> ProbesIrradiance : register(t__SRV__);
|
|
||||||
@4// Global Illumination: Utilities
|
|
||||||
float4 GetGlobalIlluminationLighting(GBufferSample gBuffer)
|
|
||||||
{
|
|
||||||
float3 irradiance = SampleDDGIIrradiance(DDGI, ProbesState, ProbesDistance, ProbesIrradiance, gBuffer.WorldPos, gBuffer.Normal);
|
|
||||||
float3 diffuseColor = GetDiffuseColor(gBuffer);
|
|
||||||
float3 diffuse = Diffuse_Lambert(diffuseColor);
|
|
||||||
return float4(diffuse * irradiance, saturate(length(irradiance)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@5// Global Illumination: Shaders
|
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "./Flax/Common.hlsl"
|
#include "./Flax/Common.hlsl"
|
||||||
#include "./Flax/GBufferCommon.hlsl"
|
#include "./Flax/GBufferCommon.hlsl"
|
||||||
#include "./Flax/Matrix.hlsl"
|
#include "./Flax/Matrix.hlsl"
|
||||||
#include "./Flax/Noise.hlsl"
|
|
||||||
@7
|
@7
|
||||||
// Primary constant buffer
|
// Primary constant buffer
|
||||||
META_CB_BEGIN(0, Data)
|
META_CB_BEGIN(0, Data)
|
||||||
@@ -63,6 +62,68 @@ float Rand(inout uint seed)
|
|||||||
return asfloat((seed >> 9) | 0x3f800000) - 1.0f;
|
return asfloat((seed >> 9) | 0x3f800000) - 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float4 Mod289(float4 x)
|
||||||
|
{
|
||||||
|
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 Perm(float4 x)
|
||||||
|
{
|
||||||
|
return Mod289(((x * 34.0) + 1.0) * x);
|
||||||
|
}
|
||||||
|
|
||||||
|
float Noise(float3 p)
|
||||||
|
{
|
||||||
|
float3 a = floor(p);
|
||||||
|
float3 d = p - a;
|
||||||
|
d = d * d * (3.0 - 2.0 * d);
|
||||||
|
|
||||||
|
float4 b = a.xxyy + float4(0.0, 1.0, 0.0, 1.0);
|
||||||
|
float4 k1 = Perm(b.xyxy);
|
||||||
|
float4 k2 = Perm(k1.xyxy + b.zzww);
|
||||||
|
|
||||||
|
float4 c = k2 + a.zzzz;
|
||||||
|
float4 k3 = Perm(c);
|
||||||
|
float4 k4 = Perm(c + 1.0);
|
||||||
|
|
||||||
|
float4 o1 = frac(k3 * (1.0 / 41.0));
|
||||||
|
float4 o2 = frac(k4 * (1.0 / 41.0));
|
||||||
|
|
||||||
|
float4 o3 = o2 * d.z + o1 * (1.0 - d.z);
|
||||||
|
float2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
|
||||||
|
|
||||||
|
return o4.y * d.y + o4.x * (1.0 - d.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
float3 Noise3D(float3 p)
|
||||||
|
{
|
||||||
|
float o = Noise(p);
|
||||||
|
float a = Noise(p + float3(0.0001f, 0.0f, 0.0f));
|
||||||
|
float b = Noise(p + float3(0.0f, 0.0001f, 0.0f));
|
||||||
|
float c = Noise(p + float3(0.0f, 0.0f, 0.0001f));
|
||||||
|
|
||||||
|
float3 grad = float3(o - a, o - b, o - c);
|
||||||
|
float3 other = abs(grad.zxy);
|
||||||
|
return normalize(cross(grad,other));
|
||||||
|
}
|
||||||
|
|
||||||
|
float3 Noise3D(float3 position, int octaves, float roughness)
|
||||||
|
{
|
||||||
|
float weight = 0.0f;
|
||||||
|
float3 noise = float3(0.0, 0.0, 0.0);
|
||||||
|
float scale = 1.0f;
|
||||||
|
for (int i = 0; i < octaves; i++)
|
||||||
|
{
|
||||||
|
float curWeight = pow((1.0-((float)i / octaves)), lerp(2.0, 0.2, roughness));
|
||||||
|
|
||||||
|
noise += Noise3D(position * scale) * curWeight;
|
||||||
|
weight += curWeight;
|
||||||
|
|
||||||
|
scale *= 1.72531;
|
||||||
|
}
|
||||||
|
return noise / weight;
|
||||||
|
}
|
||||||
|
|
||||||
// Reprojects the world space position from the given UV and raw device depth
|
// Reprojects the world space position from the given UV and raw device depth
|
||||||
float3 ReprojectPosition(float2 uv, float rawDepth)
|
float3 ReprojectPosition(float2 uv, float rawDepth)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ float3 ViewDir;
|
|||||||
float TimeParam;
|
float TimeParam;
|
||||||
float4 ViewInfo;
|
float4 ViewInfo;
|
||||||
float4 ScreenSize;
|
float4 ScreenSize;
|
||||||
float4 ViewSize;
|
|
||||||
@1META_CB_END
|
@1META_CB_END
|
||||||
|
|
||||||
// Shader resources
|
// Shader resources
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ struct VertexOutput
|
|||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
|
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
|
||||||
#endif
|
#endif
|
||||||
nointerpolation float3 InstanceOrigin : TEXCOORD6;
|
float3 InstanceOrigin : TEXCOORD6;
|
||||||
nointerpolation float InstanceParams : TEXCOORD7; // x-PerInstanceRandom
|
float InstanceParams : TEXCOORD7; // x-PerInstanceRandom
|
||||||
};
|
};
|
||||||
|
|
||||||
// Interpolants passed to the pixel shader
|
// Interpolants passed to the pixel shader
|
||||||
@@ -94,8 +94,8 @@ struct PixelInput
|
|||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
|
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT] : TEXCOORD9;
|
||||||
#endif
|
#endif
|
||||||
nointerpolation float3 InstanceOrigin : TEXCOORD6;
|
float3 InstanceOrigin : TEXCOORD6;
|
||||||
nointerpolation float InstanceParams : TEXCOORD7; // x-PerInstanceRandom
|
float InstanceParams : TEXCOORD7; // x-PerInstanceRandom
|
||||||
bool IsFrontFace : SV_IsFrontFace;
|
bool IsFrontFace : SV_IsFrontFace;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -694,18 +694,4 @@ void PS_Depth(PixelInput input)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _PS_QuadOverdraw
|
|
||||||
|
|
||||||
#include "./Flax/Editor/QuadOverdraw.hlsl"
|
|
||||||
|
|
||||||
// Pixel Shader function for Quad Overdraw Pass (editor-only)
|
|
||||||
[earlydepthstencil]
|
|
||||||
META_PS(USE_EDITOR, FEATURE_LEVEL_SM5)
|
|
||||||
void PS_QuadOverdraw(float4 svPos : SV_Position, uint primId : SV_PrimitiveID)
|
|
||||||
{
|
|
||||||
DoQuadOverdraw(svPos, primId);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@9
|
@9
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ float4x4 WorldMatrix;
|
|||||||
float4x4 ViewMatrix;
|
float4x4 ViewMatrix;
|
||||||
float4x4 PrevViewProjectionMatrix;
|
float4x4 PrevViewProjectionMatrix;
|
||||||
float4x4 PrevWorldMatrix;
|
float4x4 PrevWorldMatrix;
|
||||||
float4x4 MainViewProjectionMatrix;
|
|
||||||
float4 MainScreenSize;
|
|
||||||
float3 ViewPos;
|
float3 ViewPos;
|
||||||
float ViewFar;
|
float ViewFar;
|
||||||
float3 ViewDir;
|
float3 ViewDir;
|
||||||
@@ -45,8 +43,8 @@ struct GeometryData
|
|||||||
#endif
|
#endif
|
||||||
float3 WorldNormal : TEXCOORD3;
|
float3 WorldNormal : TEXCOORD3;
|
||||||
float4 WorldTangent : TEXCOORD4;
|
float4 WorldTangent : TEXCOORD4;
|
||||||
nointerpolation float3 InstanceOrigin : TEXCOORD5;
|
float3 InstanceOrigin : TEXCOORD5;
|
||||||
nointerpolation float2 InstanceParams : TEXCOORD6; // x-PerInstanceRandom, y-LODDitherFactor
|
float2 InstanceParams : TEXCOORD6; // x-PerInstanceRandom, y-LODDitherFactor
|
||||||
float3 PrevWorldPosition : TEXCOORD7;
|
float3 PrevWorldPosition : TEXCOORD7;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -596,7 +594,7 @@ void ClipLODTransition(PixelInput input)
|
|||||||
// Pixel Shader function for Depth Pass
|
// Pixel Shader function for Depth Pass
|
||||||
META_PS(true, FEATURE_LEVEL_ES2)
|
META_PS(true, FEATURE_LEVEL_ES2)
|
||||||
void PS_Depth(PixelInput input)
|
void PS_Depth(PixelInput input)
|
||||||
{
|
{
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
// LOD masking
|
// LOD masking
|
||||||
ClipLODTransition(input);
|
ClipLODTransition(input);
|
||||||
@@ -617,18 +615,4 @@ void PS_Depth(PixelInput input)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _PS_QuadOverdraw
|
|
||||||
|
|
||||||
#include "./Flax/Editor/QuadOverdraw.hlsl"
|
|
||||||
|
|
||||||
// Pixel Shader function for Quad Overdraw Pass (editor-only)
|
|
||||||
[earlydepthstencil]
|
|
||||||
META_PS(USE_EDITOR, FEATURE_LEVEL_SM5)
|
|
||||||
void PS_QuadOverdraw(float4 svPos : SV_Position, uint primId : SV_PrimitiveID)
|
|
||||||
{
|
|
||||||
DoQuadOverdraw(svPos, primId);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@9
|
@9
|
||||||
|
|||||||
@@ -458,18 +458,4 @@ void PS_Depth(PixelInput input)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _PS_QuadOverdraw
|
|
||||||
|
|
||||||
#include "./Flax/Editor/QuadOverdraw.hlsl"
|
|
||||||
|
|
||||||
// Pixel Shader function for Quad Overdraw Pass (editor-only)
|
|
||||||
[earlydepthstencil]
|
|
||||||
META_PS(USE_EDITOR, FEATURE_LEVEL_SM5)
|
|
||||||
void PS_QuadOverdraw(float4 svPos : SV_Position, uint primId : SV_PrimitiveID)
|
|
||||||
{
|
|
||||||
DoQuadOverdraw(svPos, primId);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@9
|
@9
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
Custom fork: [https://github.com/FlaxEngine/mono](https://github.com/FlaxEngine/mono) with custom features for C# assemblies hot-reloading at runtime without domain unload (more: [https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/](https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/)).
|
Custom fork: [https://github.com/FlaxEngine/mono](https://github.com/FlaxEngine/mono) with custom features for C# assemblies hot-reloading at runtime without domain unload (more: [https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/](https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/)).
|
||||||
|
|
||||||
Startup docs about building mono: [https://www.mono-project.com/docs/compiling-mono/](https://www.mono-project.com/docs/compiling-mono/)
|
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
Some useful notes and tips for devs:
|
Some useful notes and tips for devs:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user