Compare commits
39 Commits
work
...
woa_suppor
| Author | SHA1 | Date | |
|---|---|---|---|
| 74dcea373c | |||
| 70f8492c01 | |||
| 63acdccd43 | |||
| 03f74b0c50 | |||
| 0d21a3ba1b | |||
| d85a5bcd36 | |||
| 585ebceb6a | |||
| 593c82543f | |||
| 7f1bcd91f5 | |||
| 58214ffc35 | |||
| 67b4b01697 | |||
| bd880c0e2f | |||
| 0bca21a1d4 | |||
| c5e3d4afd3 | |||
| bb1bee40e4 | |||
| 1b0b8998f9 | |||
| e4764c4d84 | |||
| 2de756f761 | |||
| 83f40be4f5 | |||
| 87a73c9b73 | |||
| 7054f942f6 | |||
| 227eaff9e2 | |||
| 563a45633f | |||
| 09e0754902 | |||
| 3dfe0e6c5a | |||
| 9e7af72046 | |||
| 96eb8cb0ca | |||
| ff86057a0a | |||
| 56abd82c9b | |||
| 9777bef9df | |||
| 9fedacb404 | |||
| 84f7fde753 | |||
| a5566d297f | |||
| 3f299f99cd | |||
| 741fc959e6 | |||
| 93fd560723 | |||
| cf48ce6d93 | |||
| bdd3b754bd | |||
| 99c27c9c30 |
2
.github/actions/vulkan/action.yml
vendored
2
.github/actions/vulkan/action.yml
vendored
@@ -3,7 +3,7 @@ description: Downloads and installs Vulkan SDK.
|
|||||||
inputs:
|
inputs:
|
||||||
vulkan-version:
|
vulkan-version:
|
||||||
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
|
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
|
||||||
default: '1.3.290.0'
|
default: '1.2.198.1'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|||||||
87
.github/data/Build Settings.json
vendored
87
.github/data/Build Settings.json
vendored
@@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
"ID": "2364031e4e327637c1ad88b415fa756e",
|
|
||||||
"TypeName": "FlaxEditor.Content.Settings.BuildSettings",
|
|
||||||
"EngineBuild": 6605,
|
|
||||||
"Data": {
|
|
||||||
"OutputName": "${PROJECT_NAME}",
|
|
||||||
"MaxAssetsPerPackage": 4096,
|
|
||||||
"MaxPackageSizeMB": 1024,
|
|
||||||
"ContentKey": 0,
|
|
||||||
"ForDistribution": false,
|
|
||||||
"SkipPackaging": true,
|
|
||||||
"AdditionalAssets": null,
|
|
||||||
"AdditionalScenes": null,
|
|
||||||
"AdditionalAssetFolders": null,
|
|
||||||
"ShadersNoOptimize": false,
|
|
||||||
"ShadersGenerateDebugData": false,
|
|
||||||
"SkipDefaultFonts": false,
|
|
||||||
"SkipDotnetPackaging": false,
|
|
||||||
"SkipUnusedDotnetLibsPackaging": true,
|
|
||||||
"Presets": [
|
|
||||||
{
|
|
||||||
"Name": "Development",
|
|
||||||
"Targets": [
|
|
||||||
{
|
|
||||||
"Name": "Windows",
|
|
||||||
"Output": "Output\\Windows",
|
|
||||||
"Platform": 2,
|
|
||||||
"Mode": 1,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Linux",
|
|
||||||
"Output": "Output\\Linux",
|
|
||||||
"Platform": 6,
|
|
||||||
"Mode": 1,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Mac",
|
|
||||||
"Output": "Output\\Mac",
|
|
||||||
"Platform": 13,
|
|
||||||
"Mode": 1,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Android",
|
|
||||||
"Output": "Output\\Android",
|
|
||||||
"Platform": 9,
|
|
||||||
"Mode": 1,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "iOS",
|
|
||||||
"Output": "Output\\iOS",
|
|
||||||
"Platform": 14,
|
|
||||||
"Mode": 1,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "Release",
|
|
||||||
"Targets": [
|
|
||||||
{
|
|
||||||
"Name": "Windows",
|
|
||||||
"Output": "Output\\Windows",
|
|
||||||
"Platform": 2,
|
|
||||||
"Mode": 2,
|
|
||||||
"CustomDefines": null,
|
|
||||||
"PreBuildAction": null,
|
|
||||||
"PostBuildAction": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
5
.github/data/Cook.ps1
vendored
5
.github/data/Cook.ps1
vendored
@@ -1,5 +0,0 @@
|
|||||||
Write-Output "Cooking Game"
|
|
||||||
Start-Process -filepath "Binaries\Editor\Win64\Development\FlaxEditor.exe" -Wait -NoNewWindow -PassThru -ArgumentList '-std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.Windows"'
|
|
||||||
|
|
||||||
Write-Output "Testing Game"
|
|
||||||
Start-Process -filepath "FlaxSamples\MaterialsFeaturesTour\Output\Windows\MaterialsFeaturesTour.exe" -Wait -NoNewWindow -PassThru -ArgumentList '-std -headless -mute -null'
|
|
||||||
11
.github/data/ExitOnEsc.cs
vendored
11
.github/data/ExitOnEsc.cs
vendored
@@ -1,11 +0,0 @@
|
|||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
public class ExitOnEsc : Script
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override void OnUpdate()
|
|
||||||
{
|
|
||||||
// Exit as soon as game starts update loaded level
|
|
||||||
Engine.RequestExit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
2
.github/workflows/build_ios.yml
vendored
2
.github/workflows/build_ios.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
# Game
|
# Game
|
||||||
game-windows:
|
game-windows:
|
||||||
name: Game (iOS, Release ARM64)
|
name: Game (iOS, Release ARM64)
|
||||||
runs-on: "macos-14"
|
runs-on: "macos-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
11
.github/workflows/build_linux.yml
vendored
11
.github/workflows/build_linux.yml
vendored
@@ -10,13 +10,16 @@ jobs:
|
|||||||
# Editor
|
# Editor
|
||||||
editor-linux:
|
editor-linux:
|
||||||
name: Editor (Linux, Development x64)
|
name: Editor (Linux, Development x64)
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
|
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: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -38,13 +41,13 @@ jobs:
|
|||||||
# Game
|
# Game
|
||||||
game-linux:
|
game-linux:
|
||||||
name: Game (Linux, Release x64)
|
name: Game (Linux, Release x64)
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev libwayland-dev
|
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev
|
||||||
- name: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
|
|||||||
4
.github/workflows/build_linux_sources.list
vendored
Normal file
4
.github/workflows/build_linux_sources.list
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
|
||||||
|
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
|
||||||
|
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
|
||||||
|
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
|
||||||
4
.github/workflows/build_mac.yml
vendored
4
.github/workflows/build_mac.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
# Editor
|
# Editor
|
||||||
editor-mac:
|
editor-mac:
|
||||||
name: Editor (Mac, Development ARM64)
|
name: Editor (Mac, Development ARM64)
|
||||||
runs-on: "macos-14"
|
runs-on: "macos-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
# Game
|
# Game
|
||||||
game-mac:
|
game-mac:
|
||||||
name: Game (Mac, Release ARM64)
|
name: Game (Mac, Release ARM64)
|
||||||
runs-on: "macos-14"
|
runs-on: "macos-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
55
.github/workflows/cd.yml
vendored
55
.github/workflows/cd.yml
vendored
@@ -1,13 +1,12 @@
|
|||||||
name: Continuous Deployment
|
name: Continuous Deployment
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '15 6 * * *'
|
- cron: '15 4 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOTNET_NOLOGO: true
|
DOTNET_NOLOGO: true
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: false
|
DOTNET_CLI_TELEMETRY_OPTOUT: false
|
||||||
GIT_LFS_PULL_OPTIONS: '-c lfs.concurrenttransfers=1 -c lfs.transfer.maxretries=2 -c http.version="HTTP/1.1" -c lfs.activitytimeout=60'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -21,7 +20,7 @@ jobs:
|
|||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -34,14 +33,14 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
|
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Windows-Editor
|
name: Windows-Editor
|
||||||
path: Output/Editor.zip
|
path: Output/Editor.zip
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Windows-EditorDebugSymbols
|
name: Windows-EditorDebugSymbols
|
||||||
path: Output/EditorDebugSymbols.zip
|
path: Output/EditorDebugSymbols.zip
|
||||||
@@ -54,7 +53,7 @@ jobs:
|
|||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -67,9 +66,9 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
|
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Windows-Game
|
name: Windows-Game
|
||||||
path: Output/Windows.zip
|
path: Output/Windows.zip
|
||||||
@@ -77,16 +76,19 @@ jobs:
|
|||||||
# Linux
|
# Linux
|
||||||
package-linux-editor:
|
package-linux-editor:
|
||||||
name: Editor (Linux)
|
name: Editor (Linux)
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
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
|
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
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
@@ -100,24 +102,27 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
|
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Linux-Editor
|
name: Linux-Editor
|
||||||
path: Output/FlaxEditorLinux.zip
|
path: Output/FlaxEditorLinux.zip
|
||||||
package-linux-game:
|
package-linux-game:
|
||||||
name: Game (Linux)
|
name: Game (Linux)
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
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
|
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
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
@@ -131,9 +136,9 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
|
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Linux-Game
|
name: Linux-Game
|
||||||
path: Output/Linux.zip
|
path: Output/Linux.zip
|
||||||
@@ -141,14 +146,14 @@ jobs:
|
|||||||
# Mac
|
# Mac
|
||||||
package-mac-editor:
|
package-mac-editor:
|
||||||
name: Editor (Mac)
|
name: Editor (Mac)
|
||||||
runs-on: "macos-14"
|
runs-on: "macos-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -161,22 +166,22 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
|
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Mac-Editor
|
name: Mac-Editor
|
||||||
path: Output/FlaxEditorMac.zip
|
path: Output/FlaxEditorMac.zip
|
||||||
package-mac-game:
|
package-mac-game:
|
||||||
name: Game (Mac)
|
name: Game (Mac)
|
||||||
runs-on: "macos-14"
|
runs-on: "macos-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Checkout LFS
|
- name: Checkout LFS
|
||||||
run: |
|
run: |
|
||||||
git lfs version
|
git lfs version
|
||||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
git lfs pull
|
||||||
- name: Setup Vulkan
|
- name: Setup Vulkan
|
||||||
uses: ./.github/actions/vulkan
|
uses: ./.github/actions/vulkan
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
@@ -189,9 +194,9 @@ jobs:
|
|||||||
dotnet workload --info
|
dotnet workload --info
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
|
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Mac-Game
|
name: Mac-Game
|
||||||
path: Output/Mac.zip
|
path: Output/Mac.zip
|
||||||
|
|||||||
48
.github/workflows/cooking.yml
vendored
48
.github/workflows/cooking.yml
vendored
@@ -1,48 +0,0 @@
|
|||||||
name: Cooker
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
env:
|
|
||||||
DOTNET_NOLOGO: true
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Cook on Mac
|
|
||||||
cook-mac:
|
|
||||||
name: Cook (Mac)
|
|
||||||
runs-on: "macos-14"
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Vulkan
|
|
||||||
uses: ./.github/actions/vulkan
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v3
|
|
||||||
with:
|
|
||||||
dotnet-version: 8.0.x
|
|
||||||
- name: Setup .NET Workload
|
|
||||||
run: |
|
|
||||||
dotnet workload install ios
|
|
||||||
- name: Print .NET info
|
|
||||||
run: |
|
|
||||||
dotnet --info
|
|
||||||
dotnet workload --info
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
git lfs version
|
|
||||||
git lfs pull
|
|
||||||
- name: Get Flax Samples
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
repository: FlaxEngine/FlaxSamples
|
|
||||||
path: FlaxSamples
|
|
||||||
- name: Patch Files
|
|
||||||
run: |
|
|
||||||
cp .github/data/ExitOnEsc.cs FlaxSamples/MaterialsFeaturesTour/Source/Game
|
|
||||||
cp ".github/data/Build Settings.json" "FlaxSamples/MaterialsFeaturesTour/Content/Settings"
|
|
||||||
- name: Build Editor
|
|
||||||
run: |
|
|
||||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
|
||||||
- name: Cook Game (iOS)
|
|
||||||
run: |
|
|
||||||
./Binaries/Editor/Mac/Development/FlaxEditor -std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.iOS"
|
|
||||||
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
# Tests on Linux
|
# Tests on Linux
|
||||||
tests-linux:
|
tests-linux:
|
||||||
name: Tests (Linux)
|
name: Tests (Linux)
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-20.04"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -28,7 +28,10 @@ jobs:
|
|||||||
git lfs pull
|
git lfs pull
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
|
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
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
|
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
|
||||||
@@ -73,11 +76,8 @@ jobs:
|
|||||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
|
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
|
||||||
dotnet msbuild Source\Tools\Flax.Build.Tests\Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
|
dotnet msbuild Source\Tools\Flax.Build.Tests\Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
|
||||||
- name: Test
|
- name: Test
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
|
||||||
.\Binaries\Editor\Win64\Development\FlaxTests.exe
|
.\Binaries\Editor\Win64\Development\FlaxTests.exe
|
||||||
if(!$?) { Write-Host "Tests failed with exit code $LastExitCode" -ForegroundColor Red; Exit $LastExitCode }
|
|
||||||
dotnet test -f net8.0 Binaries\Tests\Flax.Build.Tests.dll
|
dotnet test -f net8.0 Binaries\Tests\Flax.Build.Tests.dll
|
||||||
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.dll Binaries\Tests
|
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.dll Binaries\Tests
|
||||||
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.runtimeconfig.json Binaries\Tests
|
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.runtimeconfig.json Binaries\Tests
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Redirect to our own Git LFS server
|
# Redirect to our own Git LFS server
|
||||||
[lfs]
|
[lfs]
|
||||||
url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
|
#url="https://gitlab.flaxengine.com/flax/flaxengine.git/info/lfs"
|
||||||
locksverify = false
|
locksverify = false
|
||||||
|
|||||||
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
Content/Editor/Icons/Decal.flax
LFS
BIN
Content/Editor/Icons/Decal.flax
LFS
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
Content/Editor/Icons/Skybox.flax
LFS
BIN
Content/Editor/Icons/Skybox.flax
LFS
Binary file not shown.
Binary file not shown.
@@ -83,12 +83,6 @@ float3 GetObjectSize(MaterialInput input)
|
|||||||
return float3(1, 1, 1);
|
return float3(1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the current object scale (supports instancing)
|
|
||||||
float3 GetObjectScale(MaterialInput input)
|
|
||||||
{
|
|
||||||
return float3(1, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current object random value supports instancing)
|
// Get the current object random value supports instancing)
|
||||||
float GetPerInstanceRandom(MaterialInput input)
|
float GetPerInstanceRandom(MaterialInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -207,20 +207,6 @@ float3 GetObjectSize(MaterialInput input)
|
|||||||
return GeometrySize * float3(world._m00, world._m11, world._m22);
|
return GeometrySize * float3(world._m00, world._m11, world._m22);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the current object scale (supports instancing)
|
|
||||||
float3 GetObjectScale(MaterialInput input)
|
|
||||||
{
|
|
||||||
float4x4 world = WorldMatrix;
|
|
||||||
|
|
||||||
// Extract scale from the world matrix
|
|
||||||
float3 scale;
|
|
||||||
scale.x = length(float3(world._11, world._12, world._13));
|
|
||||||
scale.y = length(float3(world._21, world._22, world._23));
|
|
||||||
scale.z = length(float3(world._31, world._32, world._33));
|
|
||||||
|
|
||||||
return scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current object random value
|
// Get the current object random value
|
||||||
float GetPerInstanceRandom(MaterialInput input)
|
float GetPerInstanceRandom(MaterialInput input)
|
||||||
{
|
{
|
||||||
@@ -311,7 +297,7 @@ VertexOutput VS_SplineModel(ModelInput input)
|
|||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
|
|
||||||
// Pass vertex attributes
|
// Pass vertex attributes
|
||||||
output.Geometry.TexCoord = input.TexCoord0;
|
output.Geometry.TexCoord = input.TexCoord;
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
output.Geometry.VertexColor = input.Color;
|
output.Geometry.VertexColor = input.Color;
|
||||||
#endif
|
#endif
|
||||||
@@ -337,7 +323,6 @@ VertexOutput VS_SplineModel(ModelInput input)
|
|||||||
// Apply world position offset per-vertex
|
// Apply world position offset per-vertex
|
||||||
#if USE_POSITION_OFFSET
|
#if USE_POSITION_OFFSET
|
||||||
output.Geometry.WorldPosition += material.PositionOffset;
|
output.Geometry.WorldPosition += material.PositionOffset;
|
||||||
output.Geometry.PrevWorldPosition += material.PositionOffset;
|
|
||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Deferred Shading: Defines
|
@0// Deferred Shading: Defines
|
||||||
@1// Deferred Shading: Includes
|
@1// Deferred Shading: Includes
|
||||||
@@ -26,12 +26,14 @@ void PS_GBuffer(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
Light = float4(0, 0, 0, 1);
|
Light = float4(0, 0, 0, 1);
|
||||||
MaterialInput materialInput = GetMaterialInput(input);
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
ClipLODTransition(materialInput);
|
// LOD masking
|
||||||
|
ClipLODTransition(input);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get material parameters
|
// Get material parameters
|
||||||
|
MaterialInput materialInput = GetMaterialInput(input);
|
||||||
Material material = GetMaterialPS(materialInput);
|
Material material = GetMaterialPS(materialInput);
|
||||||
|
|
||||||
// Masking
|
// Masking
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Distortion: Defines
|
@0// Distortion: Defines
|
||||||
@1// Distortion: Includes
|
@1// Distortion: Includes
|
||||||
@@ -12,12 +12,13 @@
|
|||||||
META_PS(USE_DISTORTION, FEATURE_LEVEL_ES2)
|
META_PS(USE_DISTORTION, FEATURE_LEVEL_ES2)
|
||||||
float4 PS_Distortion(PixelInput input) : SV_Target0
|
float4 PS_Distortion(PixelInput input) : SV_Target0
|
||||||
{
|
{
|
||||||
MaterialInput materialInput = GetMaterialInput(input);
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
ClipLODTransition(materialInput);
|
// LOD masking
|
||||||
|
ClipLODTransition(input);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get material parameters
|
// Get material parameters
|
||||||
|
MaterialInput materialInput = GetMaterialInput(input);
|
||||||
Material material = GetMaterialPS(materialInput);
|
Material material = GetMaterialPS(materialInput);
|
||||||
|
|
||||||
// Masking
|
// Masking
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Forward Shading: Defines
|
@0// Forward Shading: Defines
|
||||||
#define MAX_LOCAL_LIGHTS 4
|
#define MAX_LOCAL_LIGHTS 4
|
||||||
@@ -28,13 +28,6 @@ TextureCube SkyLightTexture : register(t__SRV__);
|
|||||||
Buffer<float4> ShadowsBuffer : register(t__SRV__);
|
Buffer<float4> ShadowsBuffer : register(t__SRV__);
|
||||||
Texture2D<float> ShadowMap : register(t__SRV__);
|
Texture2D<float> ShadowMap : register(t__SRV__);
|
||||||
@4// Forward Shading: Utilities
|
@4// Forward Shading: Utilities
|
||||||
// Public accessors for lighting data, use them as data binding might change but those methods will remain.
|
|
||||||
LightData GetDirectionalLight() { return DirectionalLight; }
|
|
||||||
LightData GetSkyLight() { return SkyLight; }
|
|
||||||
ProbeData GetEnvironmentProbe() { return EnvironmentProbe; }
|
|
||||||
ExponentialHeightFogData GetExponentialHeightFog() { return ExponentialHeightFog; }
|
|
||||||
uint GetLocalLightsCount() { return LocalLightsCount; }
|
|
||||||
LightData GetLocalLight(uint i) { return LocalLights[i]; }
|
|
||||||
@5// Forward Shading: Shaders
|
@5// Forward Shading: Shaders
|
||||||
|
|
||||||
// Pixel Shader function for Forward Pass
|
// Pixel Shader function for Forward Pass
|
||||||
@@ -45,12 +38,14 @@ void PS_Forward(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
output = 0;
|
output = 0;
|
||||||
MaterialInput materialInput = GetMaterialInput(input);
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
ClipLODTransition(materialInput);
|
// LOD masking
|
||||||
|
ClipLODTransition(input);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get material parameters
|
// Get material parameters
|
||||||
|
MaterialInput materialInput = GetMaterialInput(input);
|
||||||
Material material = GetMaterialPS(materialInput);
|
Material material = GetMaterialPS(materialInput);
|
||||||
|
|
||||||
// Masking
|
// Masking
|
||||||
@@ -83,8 +78,9 @@ void PS_Forward(
|
|||||||
gBuffer.ShadingModel = MATERIAL_SHADING_MODEL;
|
gBuffer.ShadingModel = MATERIAL_SHADING_MODEL;
|
||||||
|
|
||||||
// Calculate lighting from a single directional light
|
// Calculate lighting from a single directional light
|
||||||
|
float4 shadowMask = 1.0f;
|
||||||
ShadowSample shadow = SampleDirectionalLightShadow(DirectionalLight, ShadowsBuffer, ShadowMap, gBuffer);
|
ShadowSample shadow = SampleDirectionalLightShadow(DirectionalLight, ShadowsBuffer, ShadowMap, gBuffer);
|
||||||
float4 shadowMask = GetShadowMask(shadow);
|
shadowMask = GetShadowMask(shadow);
|
||||||
float4 light = GetLighting(ViewPos, DirectionalLight, gBuffer, shadowMask, false, false);
|
float4 light = GetLighting(ViewPos, DirectionalLight, gBuffer, shadowMask, false, false);
|
||||||
|
|
||||||
// Calculate lighting from sky light
|
// Calculate lighting from sky light
|
||||||
@@ -125,20 +121,6 @@ void PS_Forward(
|
|||||||
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
|
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
|
||||||
reflections = lerp(reflections, screenColor, hit.z);
|
reflections = lerp(reflections, screenColor, hit.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to software tracing if possible
|
|
||||||
#if USE_GLOBAL_SURFACE_ATLAS && CAN_USE_GLOBAL_SURFACE_ATLAS
|
|
||||||
if (hit.z < REFLECTIONS_HIT_THRESHOLD)
|
|
||||||
{
|
|
||||||
float3 reflectWS = ScreenSpaceReflectionDirection(screenUV, gBuffer, ViewPos);
|
|
||||||
float4 surfaceAtlas;
|
|
||||||
if (TraceSDFSoftwareReflections(gBuffer, reflectWS, surfaceAtlas))
|
|
||||||
{
|
|
||||||
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
|
|
||||||
reflections = lerp(surfaceAtlas, float4(screenColor, 1), hit.z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
light.rgb += reflections * GetReflectionSpecularLighting(ViewPos, gBuffer) * light.a;
|
light.rgb += reflections * GetReflectionSpecularLighting(ViewPos, gBuffer) * light.a;
|
||||||
@@ -149,9 +131,9 @@ void PS_Forward(
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_FOG && MATERIAL_SHADING_MODEL != SHADING_MODEL_UNLIT
|
#if USE_FOG
|
||||||
// Calculate exponential height fog
|
// Calculate exponential height fog
|
||||||
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0, gBuffer.ViewPos.z);
|
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0);
|
||||||
|
|
||||||
// Apply fog to the output color
|
// Apply fog to the output color
|
||||||
#if MATERIAL_BLEND == MATERIAL_BLEND_OPAQUE
|
#if MATERIAL_BLEND == MATERIAL_BLEND_OPAQUE
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Global Illumination: Defines
|
@0// Global Illumination: Defines
|
||||||
#define USE_GI 1
|
#define USE_GI 1
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Lightmap: Defines
|
@0// Lightmap: Defines
|
||||||
#define CAN_USE_LIGHTMAP 1
|
#define CAN_USE_LIGHTMAP 1
|
||||||
@1// Lightmap: Includes
|
@1// Lightmap: Includes
|
||||||
@2// Lightmap: Constants
|
@2// Lightmap: Constants
|
||||||
|
float4 LightmapArea;
|
||||||
@3// Lightmap: Resources
|
@3// Lightmap: Resources
|
||||||
#if USE_LIGHTMAP
|
#if USE_LIGHTMAP
|
||||||
// Irradiance and directionality prebaked lightmaps
|
// Irradiance and directionality prebaked lightmaps
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Motion Vectors: Defines
|
@0// Motion Vectors: Defines
|
||||||
@1// Motion Vectors: Includes
|
@1// Motion Vectors: Includes
|
||||||
@@ -11,15 +11,14 @@
|
|||||||
META_PS(true, FEATURE_LEVEL_ES2)
|
META_PS(true, FEATURE_LEVEL_ES2)
|
||||||
float4 PS_MotionVectors(PixelInput input) : SV_Target0
|
float4 PS_MotionVectors(PixelInput input) : SV_Target0
|
||||||
{
|
{
|
||||||
#if USE_DITHERED_LOD_TRANSITION || MATERIAL_MASKED
|
|
||||||
MaterialInput materialInput = GetMaterialInput(input);
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
ClipLODTransition(materialInput);
|
// LOD masking
|
||||||
#endif
|
ClipLODTransition(input);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MATERIAL_MASKED
|
#if MATERIAL_MASKED
|
||||||
// Perform per pixel clipping if material requries it
|
// Perform per pixel clipping if material requries it
|
||||||
|
MaterialInput materialInput = GetMaterialInput(input);
|
||||||
Material material = GetMaterialPS(materialInput);
|
Material material = GetMaterialPS(materialInput);
|
||||||
clip(material.Mask - MATERIAL_MASK_THRESHOLD);
|
clip(material.Mask - MATERIAL_MASK_THRESHOLD);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
|
||||||
|
|
||||||
@0// SDF Reflections: Defines
|
|
||||||
#define USE_GLOBAL_SURFACE_ATLAS 1
|
|
||||||
@1// SDF Reflections: Includes
|
|
||||||
#include "./Flax/GlobalSignDistanceField.hlsl"
|
|
||||||
#include "./Flax/GI/GlobalSurfaceAtlas.hlsl"
|
|
||||||
@2// SDF Reflections: Constants
|
|
||||||
GlobalSDFData GlobalSDF;
|
|
||||||
GlobalSurfaceAtlasData GlobalSurfaceAtlas;
|
|
||||||
@3// SDF Reflections: Resources
|
|
||||||
Texture3D<snorm float> GlobalSDFTex : register(t__SRV__);
|
|
||||||
Texture3D<snorm float> GlobalSDFMip : register(t__SRV__);
|
|
||||||
ByteAddressBuffer GlobalSurfaceAtlasChunks : register(t__SRV__);
|
|
||||||
ByteAddressBuffer RWGlobalSurfaceAtlasCulledObjects : register(t__SRV__);
|
|
||||||
Buffer<float4> GlobalSurfaceAtlasObjects : register(t__SRV__);
|
|
||||||
Texture2D GlobalSurfaceAtlasDepth : register(t__SRV__);
|
|
||||||
Texture2D GlobalSurfaceAtlasTex : register(t__SRV__);
|
|
||||||
@4// SDF Reflections: Utilities
|
|
||||||
bool TraceSDFSoftwareReflections(GBufferSample gBuffer, float3 reflectWS, out float4 surfaceAtlas)
|
|
||||||
{
|
|
||||||
GlobalSDFTrace sdfTrace;
|
|
||||||
float maxDistance = GLOBAL_SDF_WORLD_SIZE;
|
|
||||||
sdfTrace.Init(gBuffer.WorldPos, reflectWS, 0.0f, maxDistance);
|
|
||||||
GlobalSDFHit sdfHit = RayTraceGlobalSDF(GlobalSDF, GlobalSDFTex, GlobalSDFMip, sdfTrace, 2.0f);
|
|
||||||
if (sdfHit.IsHit())
|
|
||||||
{
|
|
||||||
float3 hitPosition = sdfHit.GetHitPosition(sdfTrace);
|
|
||||||
float surfaceThreshold = GetGlobalSurfaceAtlasThreshold(GlobalSDF, sdfHit);
|
|
||||||
surfaceAtlas = SampleGlobalSurfaceAtlas(GlobalSurfaceAtlas, GlobalSurfaceAtlasChunks, RWGlobalSurfaceAtlasCulledObjects, GlobalSurfaceAtlasObjects, GlobalSurfaceAtlasDepth, GlobalSurfaceAtlasTex, hitPosition, -reflectWS, surfaceThreshold);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@5// SDF Reflections: Shaders
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
@0// Tessellation: Defines
|
@0// Tessellation: Defines
|
||||||
#define TessalationProjectOntoPlane(planeNormal, planePosition, pointToProject) pointToProject - dot(pointToProject - planePosition, planeNormal) * planeNormal
|
#define TessalationProjectOntoPlane(planeNormal, planePosition, pointToProject) pointToProject - dot(pointToProject - planePosition, planeNormal) * planeNormal
|
||||||
@@ -33,13 +33,8 @@ struct TessalationDSToPS
|
|||||||
MaterialInput GetMaterialInput(TessalationDSToPS input)
|
MaterialInput GetMaterialInput(TessalationDSToPS input)
|
||||||
{
|
{
|
||||||
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
||||||
#if USE_PER_DRAW_CONSTANTS
|
|
||||||
output.Object = LoadObject(ObjectsBuffer, input.Geometry.ObjectIndex);
|
|
||||||
#else
|
|
||||||
LoadObjectFromCB(output.Object);
|
|
||||||
#endif
|
|
||||||
output.SvPosition = input.Position;
|
output.SvPosition = input.Position;
|
||||||
output.TwoSidedSign = output.Object.WorldDeterminantSign;
|
output.TwoSidedSign = WorldDeterminantSign;
|
||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
output.CustomVSToPS = input.CustomVSToPS;
|
output.CustomVSToPS = input.CustomVSToPS;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ void SetParticleVec4(uint particleIndex, int offset, float4 value)
|
|||||||
bool AddParticle(out uint dstIndex)
|
bool AddParticle(out uint dstIndex)
|
||||||
{
|
{
|
||||||
// Acquire the particle index in the destination buffer
|
// Acquire the particle index in the destination buffer
|
||||||
DstParticlesData.InterlockedAdd(ParticleCounterOffset, 1u, dstIndex);
|
DstParticlesData.InterlockedAdd(ParticleCounterOffset, 1, dstIndex);
|
||||||
|
|
||||||
// Prevent overflow
|
// Prevent overflow
|
||||||
return dstIndex >= PARTICLE_CAPACITY;
|
return dstIndex >= PARTICLE_CAPACITY;
|
||||||
|
|||||||
@@ -163,12 +163,6 @@ float3 GetObjectSize(MaterialInput input)
|
|||||||
return float3(1, 1, 1);
|
return float3(1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the current object scale (supports instancing)
|
|
||||||
float3 GetObjectScale(MaterialInput input)
|
|
||||||
{
|
|
||||||
return float3(1, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current object random value supports instancing)
|
// Get the current object random value supports instancing)
|
||||||
float GetPerInstanceRandom(MaterialInput input)
|
float GetPerInstanceRandom(MaterialInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -299,22 +299,24 @@ half3x3 CalcTangentToLocal(ModelInput input)
|
|||||||
float3 normal = input.Normal.xyz * 2.0 - 1.0;
|
float3 normal = input.Normal.xyz * 2.0 - 1.0;
|
||||||
float3 tangent = input.Tangent.xyz * 2.0 - 1.0;
|
float3 tangent = input.Tangent.xyz * 2.0 - 1.0;
|
||||||
float3 bitangent = cross(normal, tangent) * bitangentSign;
|
float3 bitangent = cross(normal, tangent) * bitangentSign;
|
||||||
return (half3x3)float3x3(tangent, bitangent, normal);
|
return float3x3(tangent, bitangent, normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
half3x3 CalcTangentToWorld(in float4x4 world, in half3x3 tangentToLocal)
|
half3x3 CalcTangentToWorld(in float4x4 world, in half3x3 tangentToLocal)
|
||||||
{
|
{
|
||||||
half3x3 localToWorld = (half3x3)RemoveScaleFromLocalToWorld((float3x3)world);
|
half3x3 localToWorld = RemoveScaleFromLocalToWorld((float3x3)world);
|
||||||
return mul(tangentToLocal, localToWorld);
|
return mul(tangentToLocal, localToWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
float3 GetParticlePosition(uint particleIndex)
|
float3 GetParticlePosition(uint ParticleIndex)
|
||||||
{
|
{
|
||||||
return TransformParticlePosition(GetParticleVec3(particleIndex, PositionOffset));
|
return TransformParticlePosition(GetParticleVec3(ParticleIndex, PositionOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vertex Shader function for Sprite Rendering
|
// Vertex Shader function for Sprite Rendering
|
||||||
META_VS(true, FEATURE_LEVEL_ES2)
|
META_VS(true, FEATURE_LEVEL_ES2)
|
||||||
|
META_VS_IN_ELEMENT(POSITION, 0, R32G32_FLOAT, 0, 0, PER_VERTEX, 0, true)
|
||||||
|
META_VS_IN_ELEMENT(TEXCOORD, 0, R32G32_FLOAT, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
VertexOutput VS_Sprite(SpriteInput input, uint particleIndex : SV_InstanceID)
|
VertexOutput VS_Sprite(SpriteInput input, uint particleIndex : SV_InstanceID)
|
||||||
{
|
{
|
||||||
VertexOutput output;
|
VertexOutput output;
|
||||||
@@ -405,7 +407,7 @@ VertexOutput VS_Sprite(SpriteInput input, uint particleIndex : SV_InstanceID)
|
|||||||
output.InstanceParams = PerInstanceRandom;
|
output.InstanceParams = PerInstanceRandom;
|
||||||
|
|
||||||
// Calculate tanget space to world space transformation matrix for unit vectors
|
// Calculate tanget space to world space transformation matrix for unit vectors
|
||||||
half3x3 tangentToLocal = half3x3(axisX, axisY, axisZ);
|
half3x3 tangentToLocal = float3x3(axisX, axisY, axisZ);
|
||||||
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||||
output.TBN = tangentToWorld;
|
output.TBN = tangentToWorld;
|
||||||
|
|
||||||
@@ -514,7 +516,7 @@ VertexOutput VS_Model(ModelInput input, uint particleIndex : SV_InstanceID)
|
|||||||
output.Position = mul(float4(output.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
|
|
||||||
// Pass vertex attributes
|
// Pass vertex attributes
|
||||||
output.TexCoord = input.TexCoord0;
|
output.TexCoord = input.TexCoord;
|
||||||
output.ParticleIndex = particleIndex;
|
output.ParticleIndex = particleIndex;
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
output.VertexColor = input.Color;
|
output.VertexColor = input.Color;
|
||||||
@@ -610,7 +612,7 @@ VertexOutput VS_Ribbon(RibbonInput input, uint vertexIndex : SV_VertexID)
|
|||||||
{
|
{
|
||||||
output.TexCoord.x = (float)input.Order / (float)RibbonSegmentCount;
|
output.TexCoord.x = (float)input.Order / (float)RibbonSegmentCount;
|
||||||
}
|
}
|
||||||
output.TexCoord.y = (float)((vertexIndex + 1) & 0x1);
|
output.TexCoord.y = (vertexIndex + 1) & 0x1;
|
||||||
output.TexCoord = output.TexCoord * RibbonUVScale + RibbonUVOffset;
|
output.TexCoord = output.TexCoord * RibbonUVScale + RibbonUVOffset;
|
||||||
|
|
||||||
// Compute world space vertex position
|
// Compute world space vertex position
|
||||||
@@ -629,7 +631,7 @@ VertexOutput VS_Ribbon(RibbonInput input, uint vertexIndex : SV_VertexID)
|
|||||||
output.InstanceParams = PerInstanceRandom;
|
output.InstanceParams = PerInstanceRandom;
|
||||||
|
|
||||||
// Calculate tanget space to world space transformation matrix for unit vectors
|
// Calculate tanget space to world space transformation matrix for unit vectors
|
||||||
half3x3 tangentToLocal = half3x3(tangentRight, tangentUp, cross(tangentRight, tangentUp));
|
half3x3 tangentToLocal = float3x3(tangentRight, tangentUp, cross(tangentRight, tangentUp));
|
||||||
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
half3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||||
output.TBN = tangentToWorld;
|
output.TBN = tangentToWorld;
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
// Version: @0
|
// Version: @0
|
||||||
|
|
||||||
#define MATERIAL 1
|
#define MATERIAL 1
|
||||||
#define MATERIAL_TEXCOORDS 4
|
|
||||||
#define USE_PER_VIEW_CONSTANTS 1
|
#define USE_PER_VIEW_CONSTANTS 1
|
||||||
#define USE_PER_DRAW_CONSTANTS 1
|
|
||||||
@3
|
@3
|
||||||
#include "./Flax/Common.hlsl"
|
#include "./Flax/Common.hlsl"
|
||||||
#include "./Flax/MaterialCommon.hlsl"
|
#include "./Flax/MaterialCommon.hlsl"
|
||||||
@@ -12,42 +10,36 @@
|
|||||||
@7
|
@7
|
||||||
// Primary constant buffer (with additional material parameters)
|
// Primary constant buffer (with additional material parameters)
|
||||||
META_CB_BEGIN(0, Data)
|
META_CB_BEGIN(0, Data)
|
||||||
|
float4x3 WorldMatrix;
|
||||||
|
float4x3 PrevWorldMatrix;
|
||||||
|
float2 Dummy0;
|
||||||
|
float LODDitherFactor;
|
||||||
|
float PerInstanceRandom;
|
||||||
|
float3 GeometrySize;
|
||||||
|
float WorldDeterminantSign;
|
||||||
@1META_CB_END
|
@1META_CB_END
|
||||||
|
|
||||||
// Shader resources
|
// Shader resources
|
||||||
@2
|
@2
|
||||||
Buffer<float4> ObjectsBuffer : register(t0);
|
|
||||||
#if USE_SKINNING
|
|
||||||
// The skeletal bones matrix buffer (stored as 4x3, 3 float4 behind each other)
|
|
||||||
Buffer<float4> BoneMatrices : register(t1);
|
|
||||||
#if PER_BONE_MOTION_BLUR
|
|
||||||
// The skeletal bones matrix buffer from the previous frame
|
|
||||||
Buffer<float4> PrevBoneMatrices : register(t2);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Geometry data passed though the graphics rendering stages up to the pixel shader
|
// Geometry data passed though the graphics rendering stages up to the pixel shader
|
||||||
struct GeometryData
|
struct GeometryData
|
||||||
{
|
{
|
||||||
float3 WorldPosition : TEXCOORD0;
|
float3 WorldPosition : TEXCOORD0;
|
||||||
float4 TexCoords01 : TEXCOORD1;
|
float2 TexCoord : TEXCOORD1;
|
||||||
float4 TexCoords23 : TEXCOORD2;
|
float2 LightmapUV : TEXCOORD2;
|
||||||
float2 LightmapUV : TEXCOORD3;
|
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
half4 VertexColor : COLOR;
|
half4 VertexColor : COLOR;
|
||||||
#endif
|
#endif
|
||||||
float3 WorldNormal : TEXCOORD4;
|
float3 WorldNormal : TEXCOORD3;
|
||||||
float4 WorldTangent : TEXCOORD5;
|
float4 WorldTangent : TEXCOORD4;
|
||||||
|
nointerpolation float3 InstanceOrigin : TEXCOORD5;
|
||||||
|
nointerpolation float2 InstanceParams : TEXCOORD6; // x-PerInstanceRandom, y-LODDitherFactor
|
||||||
float3 PrevWorldPosition : TEXCOORD7;
|
float3 PrevWorldPosition : TEXCOORD7;
|
||||||
nointerpolation uint ObjectIndex : TEXCOORD8;
|
nointerpolation float3 InstanceTransform1 : TEXCOORD8;
|
||||||
|
nointerpolation float3 InstanceTransform2 : TEXCOORD9;
|
||||||
|
nointerpolation float3 InstanceTransform3 : TEXCOORD10;
|
||||||
};
|
};
|
||||||
|
|
||||||
float3 DecodeNormal(float4 normalMap)
|
|
||||||
{
|
|
||||||
float2 xy = normalMap.rg * 2.0 - 1.0;
|
|
||||||
return float3(xy, sqrt(1.0 - saturate(dot(xy, xy))));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interpolants passed from the vertex shader
|
// Interpolants passed from the vertex shader
|
||||||
struct VertexOutput
|
struct VertexOutput
|
||||||
{
|
{
|
||||||
@@ -77,7 +69,7 @@ struct MaterialInput
|
|||||||
{
|
{
|
||||||
float3 WorldPosition;
|
float3 WorldPosition;
|
||||||
float TwoSidedSign;
|
float TwoSidedSign;
|
||||||
float2 TexCoords[MATERIAL_TEXCOORDS];
|
float2 TexCoord;
|
||||||
#if USE_LIGHTMAP
|
#if USE_LIGHTMAP
|
||||||
float2 LightmapUV;
|
float2 LightmapUV;
|
||||||
#endif
|
#endif
|
||||||
@@ -88,25 +80,22 @@ struct MaterialInput
|
|||||||
float4 SvPosition;
|
float4 SvPosition;
|
||||||
float3 PreSkinnedPosition;
|
float3 PreSkinnedPosition;
|
||||||
float3 PreSkinnedNormal;
|
float3 PreSkinnedNormal;
|
||||||
uint ObjectIndex;
|
float3 InstanceOrigin;
|
||||||
ObjectData Object;
|
float2 InstanceParams;
|
||||||
|
float3 InstanceTransform1;
|
||||||
|
float3 InstanceTransform2;
|
||||||
|
float3 InstanceTransform3;
|
||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT];
|
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT];
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Map access to the main texure coordinate channel as UV0
|
|
||||||
#define TexCoord TexCoords[0]
|
|
||||||
|
|
||||||
// Extracts geometry data to the material input
|
// Extracts geometry data to the material input
|
||||||
MaterialInput GetGeometryMaterialInput(GeometryData geometry)
|
MaterialInput GetGeometryMaterialInput(GeometryData geometry)
|
||||||
{
|
{
|
||||||
MaterialInput output = (MaterialInput)0;
|
MaterialInput output = (MaterialInput)0;
|
||||||
output.WorldPosition = geometry.WorldPosition;
|
output.WorldPosition = geometry.WorldPosition;
|
||||||
output.TexCoords[0] = geometry.TexCoords01.xy;
|
output.TexCoord = geometry.TexCoord;
|
||||||
output.TexCoords[1] = geometry.TexCoords01.zw;
|
|
||||||
output.TexCoords[2] = geometry.TexCoords23.xy;
|
|
||||||
output.TexCoords[3] = geometry.TexCoords23.zw;
|
|
||||||
#if USE_LIGHTMAP
|
#if USE_LIGHTMAP
|
||||||
output.LightmapUV = geometry.LightmapUV;
|
output.LightmapUV = geometry.LightmapUV;
|
||||||
#endif
|
#endif
|
||||||
@@ -114,7 +103,11 @@ MaterialInput GetGeometryMaterialInput(GeometryData geometry)
|
|||||||
output.VertexColor = geometry.VertexColor;
|
output.VertexColor = geometry.VertexColor;
|
||||||
#endif
|
#endif
|
||||||
output.TBN = CalcTangentBasis(geometry.WorldNormal, geometry.WorldTangent);
|
output.TBN = CalcTangentBasis(geometry.WorldNormal, geometry.WorldTangent);
|
||||||
output.ObjectIndex = geometry.ObjectIndex;
|
output.InstanceOrigin = geometry.InstanceOrigin;
|
||||||
|
output.InstanceParams = geometry.InstanceParams;
|
||||||
|
output.InstanceTransform1 = geometry.InstanceTransform1;
|
||||||
|
output.InstanceTransform2 = geometry.InstanceTransform2;
|
||||||
|
output.InstanceTransform3 = geometry.InstanceTransform3;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,8 +134,8 @@ MaterialInput GetGeometryMaterialInput(GeometryData geometry)
|
|||||||
GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, float w1, GeometryData p2, float w2)
|
GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, float w1, GeometryData p2, float w2)
|
||||||
{
|
{
|
||||||
GeometryData output = (GeometryData)0;
|
GeometryData output = (GeometryData)0;
|
||||||
output.TexCoords01 = p0.TexCoords01 * w0 + p1.TexCoords01 * w1 + p2.TexCoords01 * w2;
|
output.TexCoord = p0.TexCoord * w0 + p1.TexCoord * w1 + p2.TexCoord * w2;
|
||||||
output.TexCoords23 = p0.TexCoords23 * w0 + p1.TexCoords23 * w1 + p2.TexCoords23 * w2;
|
output.LightmapUV = p0.LightmapUV * w0 + p1.LightmapUV * w1 + p2.LightmapUV * w2;
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
output.VertexColor = p0.VertexColor * w0 + p1.VertexColor * w1 + p2.VertexColor * w2;
|
output.VertexColor = p0.VertexColor * w0 + p1.VertexColor * w1 + p2.VertexColor * w2;
|
||||||
#endif
|
#endif
|
||||||
@@ -150,7 +143,11 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
|||||||
output.WorldNormal = normalize(output.WorldNormal);
|
output.WorldNormal = normalize(output.WorldNormal);
|
||||||
output.WorldTangent = p0.WorldTangent * w0 + p1.WorldTangent * w1 + p2.WorldTangent * w2;
|
output.WorldTangent = p0.WorldTangent * w0 + p1.WorldTangent * w1 + p2.WorldTangent * w2;
|
||||||
output.WorldTangent.xyz = normalize(output.WorldTangent.xyz);
|
output.WorldTangent.xyz = normalize(output.WorldTangent.xyz);
|
||||||
output.ObjectIndex = p0.ObjectIndex;
|
output.InstanceOrigin = p0.InstanceOrigin;
|
||||||
|
output.InstanceParams = p0.InstanceParams;
|
||||||
|
output.InstanceTransform1 = p0.InstanceTransform1;
|
||||||
|
output.InstanceTransform2 = p0.InstanceTransform2;
|
||||||
|
output.InstanceTransform3 = p0.InstanceTransform3;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,8 +156,7 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
|||||||
MaterialInput GetMaterialInput(PixelInput input)
|
MaterialInput GetMaterialInput(PixelInput input)
|
||||||
{
|
{
|
||||||
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
||||||
output.Object = LoadObject(ObjectsBuffer, input.Geometry.ObjectIndex);
|
output.TwoSidedSign = WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
||||||
output.TwoSidedSign = output.Object.WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
|
||||||
output.SvPosition = input.Position;
|
output.SvPosition = input.Position;
|
||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
output.CustomVSToPS = input.CustomVSToPS;
|
output.CustomVSToPS = input.CustomVSToPS;
|
||||||
@@ -168,6 +164,16 @@ MaterialInput GetMaterialInput(PixelInput input)
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gets the local to world transform matrix
|
||||||
|
#define GetInstanceTransform(input) float4x4(float4(input.InstanceTransform1.xyz, 0.0f), float4(input.InstanceTransform2.xyz, 0.0f), float4(input.InstanceTransform3.xyz, 0.0f), float4(input.InstanceOrigin.xyz, 1.0f))
|
||||||
|
|
||||||
|
// Extarcts the world matrix and instancce transform vector
|
||||||
|
#if USE_INSTANCING
|
||||||
|
#define CalculateInstanceTransform(input) float4x4 world = GetInstanceTransform(input); output.Geometry.InstanceTransform1 = input.InstanceTransform1.xyz; output.Geometry.InstanceTransform2 = input.InstanceTransform2.xyz; output.Geometry.InstanceTransform3 = input.InstanceTransform3.xyz;
|
||||||
|
#else
|
||||||
|
#define CalculateInstanceTransform(input) float4x4 world = ToMatrix4x4(WorldMatrix); output.Geometry.InstanceTransform1 = world[0].xyz; output.Geometry.InstanceTransform2 = world[1].xyz; output.Geometry.InstanceTransform3 = world[2].xyz;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Removes the scale vector from the local to world transformation matrix (supports instancing)
|
// Removes the scale vector from the local to world transformation matrix (supports instancing)
|
||||||
float3x3 RemoveScaleFromLocalToWorld(float3x3 localToWorld)
|
float3x3 RemoveScaleFromLocalToWorld(float3x3 localToWorld)
|
||||||
{
|
{
|
||||||
@@ -212,7 +218,7 @@ float3 TransformViewVectorToWorld(MaterialInput input, float3 viewVector)
|
|||||||
// Transforms a vector from local space to world space
|
// Transforms a vector from local space to world space
|
||||||
float3 TransformLocalVectorToWorld(MaterialInput input, float3 localVector)
|
float3 TransformLocalVectorToWorld(MaterialInput input, float3 localVector)
|
||||||
{
|
{
|
||||||
float3x3 localToWorld = (float3x3)input.Object.WorldMatrix;
|
float3x3 localToWorld = (float3x3)GetInstanceTransform(input);
|
||||||
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
||||||
return mul(localVector, localToWorld);
|
return mul(localVector, localToWorld);
|
||||||
}
|
}
|
||||||
@@ -220,7 +226,7 @@ float3 TransformLocalVectorToWorld(MaterialInput input, float3 localVector)
|
|||||||
// Transforms a vector from local space to world space
|
// Transforms a vector from local space to world space
|
||||||
float3 TransformWorldVectorToLocal(MaterialInput input, float3 worldVector)
|
float3 TransformWorldVectorToLocal(MaterialInput input, float3 worldVector)
|
||||||
{
|
{
|
||||||
float3x3 localToWorld = (float3x3)input.Object.WorldMatrix;
|
float3x3 localToWorld = (float3x3)GetInstanceTransform(input);
|
||||||
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
||||||
return mul(localToWorld, worldVector);
|
return mul(localToWorld, worldVector);
|
||||||
}
|
}
|
||||||
@@ -228,44 +234,30 @@ float3 TransformWorldVectorToLocal(MaterialInput input, float3 worldVector)
|
|||||||
// Gets the current object position (supports instancing)
|
// Gets the current object position (supports instancing)
|
||||||
float3 GetObjectPosition(MaterialInput input)
|
float3 GetObjectPosition(MaterialInput input)
|
||||||
{
|
{
|
||||||
return input.Object.WorldMatrix[3].xyz;
|
return input.InstanceOrigin.xyz;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the current object size (supports instancing)
|
// Gets the current object size (supports instancing)
|
||||||
float3 GetObjectSize(MaterialInput input)
|
float3 GetObjectSize(MaterialInput input)
|
||||||
{
|
{
|
||||||
float4x4 world = input.Object.WorldMatrix;
|
float4x4 world = GetInstanceTransform(input);
|
||||||
return input.Object.GeometrySize * float3(world._m00, world._m11, world._m22);
|
return GeometrySize * float3(world._m00, world._m11, world._m22);
|
||||||
}
|
|
||||||
|
|
||||||
// Gets the current object scale (supports instancing)
|
|
||||||
float3 GetObjectScale(MaterialInput input)
|
|
||||||
{
|
|
||||||
float4x4 world = input.Object.WorldMatrix;
|
|
||||||
|
|
||||||
// Get the squares of the scale factors
|
|
||||||
float scaleXSquared = dot(world[0].xyz, world[0].xyz);
|
|
||||||
float scaleYSquared = dot(world[1].xyz, world[1].xyz);
|
|
||||||
float scaleZSquared = dot(world[2].xyz, world[2].xyz);
|
|
||||||
|
|
||||||
// Take square root to get actual scales
|
|
||||||
return float3(
|
|
||||||
sqrt(scaleXSquared),
|
|
||||||
sqrt(scaleYSquared),
|
|
||||||
sqrt(scaleZSquared)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current object random value (supports instancing)
|
// Get the current object random value (supports instancing)
|
||||||
float GetPerInstanceRandom(MaterialInput input)
|
float GetPerInstanceRandom(MaterialInput input)
|
||||||
{
|
{
|
||||||
return input.Object.PerInstanceRandom;
|
return input.InstanceParams.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current object LOD transition dither factor (supports instancing)
|
// Get the current object LOD transition dither factor (supports instancing)
|
||||||
float GetLODDitherFactor(MaterialInput input)
|
float GetLODDitherFactor(MaterialInput input)
|
||||||
{
|
{
|
||||||
return input.Object.LODDitherFactor;
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
|
return input.InstanceParams.y;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the interpolated vertex color (in linear space)
|
// Gets the interpolated vertex color (in linear space)
|
||||||
@@ -324,41 +316,44 @@ META_VS_IN_ELEMENT(NORMAL, 0, R10G10B10A2_UNORM, 1, ALIGN, PER_VERTEX, 0, true
|
|||||||
META_VS_IN_ELEMENT(TANGENT, 0, R10G10B10A2_UNORM, 1, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(TANGENT, 0, R10G10B10A2_UNORM, 1, ALIGN, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(TEXCOORD, 1, R16G16_FLOAT, 1, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(TEXCOORD, 1, R16G16_FLOAT, 1, ALIGN, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(COLOR, 0, R8G8B8A8_UNORM, 2, 0, PER_VERTEX, 0, USE_VERTEX_COLOR)
|
META_VS_IN_ELEMENT(COLOR, 0, R8G8B8A8_UNORM, 2, 0, PER_VERTEX, 0, USE_VERTEX_COLOR)
|
||||||
META_VS_IN_ELEMENT(ATTRIBUTE,0, R32_UINT, 3, 0, PER_INSTANCE, 1, USE_INSTANCING)
|
META_VS_IN_ELEMENT(ATTRIBUTE,0, R32G32B32A32_FLOAT,3, 0, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,1, R32G32B32A32_FLOAT,3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,2, R32G32B32_FLOAT, 3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,3, R32G32B32_FLOAT, 3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,4, R16G16B16A16_FLOAT,3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
VertexOutput VS(ModelInput input)
|
VertexOutput VS(ModelInput input)
|
||||||
{
|
{
|
||||||
VertexOutput output;
|
VertexOutput output;
|
||||||
|
|
||||||
// Load object data
|
|
||||||
#if USE_INSTANCING
|
|
||||||
output.Geometry.ObjectIndex = input.ObjectIndex;
|
|
||||||
#else
|
|
||||||
output.Geometry.ObjectIndex = DrawObjectIndex;
|
|
||||||
#endif
|
|
||||||
ObjectData object = LoadObject(ObjectsBuffer, output.Geometry.ObjectIndex);
|
|
||||||
|
|
||||||
// Compute world space vertex position
|
// Compute world space vertex position
|
||||||
output.Geometry.WorldPosition = mul(float4(input.Position.xyz, 1), object.WorldMatrix).xyz;
|
CalculateInstanceTransform(input);
|
||||||
output.Geometry.PrevWorldPosition = mul(float4(input.Position.xyz, 1), object.PrevWorldMatrix).xyz;
|
output.Geometry.WorldPosition = mul(float4(input.Position.xyz, 1), world).xyz;
|
||||||
|
output.Geometry.PrevWorldPosition = mul(float4(input.Position.xyz, 1), ToMatrix4x4(PrevWorldMatrix)).xyz;
|
||||||
|
|
||||||
// Compute clip space position
|
// Compute clip space position
|
||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
|
|
||||||
// Pass vertex attributes
|
// Pass vertex attributes
|
||||||
output.Geometry.TexCoords01 = float4(input.TexCoord0, input.TexCoord1);
|
output.Geometry.TexCoord = input.TexCoord;
|
||||||
output.Geometry.TexCoords23 = float4(input.TexCoord2, input.TexCoord3);
|
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
output.Geometry.VertexColor = input.Color;
|
output.Geometry.VertexColor = input.Color;
|
||||||
#endif
|
#endif
|
||||||
#if CAN_USE_LIGHTMAP
|
output.Geometry.InstanceOrigin = world[3].xyz;
|
||||||
output.Geometry.LightmapUV = input.LightmapUV * object.LightmapArea.zw + object.LightmapArea.xy;
|
#if USE_INSTANCING
|
||||||
|
output.Geometry.LightmapUV = input.LightmapUV * input.InstanceLightmapArea.zw + input.InstanceLightmapArea.xy;
|
||||||
|
output.Geometry.InstanceParams = float2(input.InstanceOrigin.w, input.InstanceTransform1.w);
|
||||||
#else
|
#else
|
||||||
output.Geometry.LightmapUV = float2(0, 0);
|
#if CAN_USE_LIGHTMAP
|
||||||
|
output.Geometry.LightmapUV = input.LightmapUV * LightmapArea.zw + LightmapArea.xy;
|
||||||
|
#else
|
||||||
|
output.Geometry.LightmapUV = input.LightmapUV;
|
||||||
|
#endif
|
||||||
|
output.Geometry.InstanceParams = float2(PerInstanceRandom, LODDitherFactor);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Calculate tanget space to world space transformation matrix for unit vectors
|
// Calculate tanget space to world space transformation matrix for unit vectors
|
||||||
float3x3 tangentToLocal = CalcTangentToLocal(input);
|
float3x3 tangentToLocal = CalcTangentToLocal(input);
|
||||||
float3x3 tangentToWorld = CalcTangentToWorld(object.WorldMatrix, tangentToLocal);
|
float3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||||
output.Geometry.WorldNormal = tangentToWorld[2];
|
output.Geometry.WorldNormal = tangentToWorld[2];
|
||||||
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
||||||
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
||||||
@@ -366,18 +361,16 @@ VertexOutput VS(ModelInput input)
|
|||||||
// Get material input params if need to evaluate any material property
|
// Get material input params if need to evaluate any material property
|
||||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
||||||
materialInput.TwoSidedSign = object.WorldDeterminantSign;
|
materialInput.TwoSidedSign = WorldDeterminantSign;
|
||||||
materialInput.SvPosition = output.Position;
|
materialInput.SvPosition = output.Position;
|
||||||
materialInput.PreSkinnedPosition = input.Position.xyz;
|
materialInput.PreSkinnedPosition = input.Position.xyz;
|
||||||
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
||||||
materialInput.Object = object;
|
|
||||||
Material material = GetMaterialVS(materialInput);
|
Material material = GetMaterialVS(materialInput);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Apply world position offset per-vertex
|
// Apply world position offset per-vertex
|
||||||
#if USE_POSITION_OFFSET
|
#if USE_POSITION_OFFSET
|
||||||
output.Geometry.WorldPosition += material.PositionOffset;
|
output.Geometry.WorldPosition += material.PositionOffset;
|
||||||
output.Geometry.PrevWorldPosition += material.PositionOffset;
|
|
||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -399,27 +392,33 @@ META_VS(true, FEATURE_LEVEL_ES2)
|
|||||||
META_PERMUTATION_1(USE_INSTANCING=0)
|
META_PERMUTATION_1(USE_INSTANCING=0)
|
||||||
META_PERMUTATION_1(USE_INSTANCING=1)
|
META_PERMUTATION_1(USE_INSTANCING=1)
|
||||||
META_VS_IN_ELEMENT(POSITION, 0, R32G32B32_FLOAT, 0, 0, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(POSITION, 0, R32G32B32_FLOAT, 0, 0, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(ATTRIBUTE,0, R32_UINT, 3, 0, PER_INSTANCE, 1, USE_INSTANCING)
|
META_VS_IN_ELEMENT(ATTRIBUTE,0, R32G32B32A32_FLOAT,3, 0, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,1, R32G32B32A32_FLOAT,3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,2, R32G32B32_FLOAT, 3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,3, R32G32B32_FLOAT, 3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
|
META_VS_IN_ELEMENT(ATTRIBUTE,4, R16G16B16A16_FLOAT,3, ALIGN, PER_INSTANCE, 1, USE_INSTANCING)
|
||||||
float4 VS_Depth(ModelInput_PosOnly input) : SV_Position
|
float4 VS_Depth(ModelInput_PosOnly input) : SV_Position
|
||||||
{
|
{
|
||||||
// Load object data
|
|
||||||
#if USE_INSTANCING
|
#if USE_INSTANCING
|
||||||
uint objectIndex = input.ObjectIndex;
|
float4x4 world = GetInstanceTransform(input);
|
||||||
#else
|
#else
|
||||||
uint objectIndex = DrawObjectIndex;
|
float4x4 world = ToMatrix4x4(WorldMatrix);
|
||||||
#endif
|
#endif
|
||||||
ObjectData object = LoadObject(ObjectsBuffer, objectIndex);
|
float3 worldPosition = mul(float4(input.Position.xyz, 1), world).xyz;
|
||||||
|
|
||||||
// Transform vertex position into the screen
|
|
||||||
float3 worldPosition = mul(float4(input.Position.xyz, 1), object.WorldMatrix).xyz;
|
|
||||||
float4 position = mul(float4(worldPosition, 1), ViewProjectionMatrix);
|
float4 position = mul(float4(worldPosition, 1), ViewProjectionMatrix);
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_SKINNING
|
#if USE_SKINNING
|
||||||
|
|
||||||
|
// The skeletal bones matrix buffer (stored as 4x3, 3 float4 behind each other)
|
||||||
|
Buffer<float4> BoneMatrices : register(t0);
|
||||||
|
|
||||||
#if PER_BONE_MOTION_BLUR
|
#if PER_BONE_MOTION_BLUR
|
||||||
|
|
||||||
|
// The skeletal bones matrix buffer from the previous frame
|
||||||
|
Buffer<float4> PrevBoneMatrices : register(t1);
|
||||||
|
|
||||||
float3x4 GetPrevBoneMatrix(int index)
|
float3x4 GetPrevBoneMatrix(int index)
|
||||||
{
|
{
|
||||||
float4 a = PrevBoneMatrices[index * 3];
|
float4 a = PrevBoneMatrices[index * 3];
|
||||||
@@ -494,42 +493,44 @@ META_VS_IN_ELEMENT(TEXCOORD, 0, R16G16_FLOAT, 0, ALIGN, PER_VERTEX, 0,
|
|||||||
META_VS_IN_ELEMENT(NORMAL, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(NORMAL, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(TANGENT, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(TANGENT, 0, R10G10B10A2_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(BLENDINDICES, 0, R8G8B8A8_UINT, 0, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(BLENDINDICES, 0, R8G8B8A8_UINT, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
META_VS_IN_ELEMENT(BLENDWEIGHTS, 0, R16G16B16A16_FLOAT,0, ALIGN, PER_VERTEX, 0, true)
|
META_VS_IN_ELEMENT(BLENDWEIGHT, 0, R16G16B16A16_FLOAT,0, ALIGN, PER_VERTEX, 0, true)
|
||||||
VertexOutput VS_Skinned(ModelInput_Skinned input)
|
VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||||
{
|
{
|
||||||
VertexOutput output;
|
VertexOutput output;
|
||||||
|
|
||||||
// Load object data
|
|
||||||
output.Geometry.ObjectIndex = DrawObjectIndex;
|
|
||||||
ObjectData object = LoadObject(ObjectsBuffer, output.Geometry.ObjectIndex);
|
|
||||||
|
|
||||||
// Perform skinning
|
// Perform skinning
|
||||||
float3x4 boneMatrix = GetBoneMatrix(input);
|
float3x4 boneMatrix = GetBoneMatrix(input);
|
||||||
float3 position = SkinPosition(input, boneMatrix);
|
float3 position = SkinPosition(input, boneMatrix);
|
||||||
float3x3 tangentToLocal = SkinTangents(input, boneMatrix);
|
float3x3 tangentToLocal = SkinTangents(input, boneMatrix);
|
||||||
|
|
||||||
// Compute world space vertex position
|
// Compute world space vertex position
|
||||||
output.Geometry.WorldPosition = mul(float4(position, 1), object.WorldMatrix).xyz;
|
CalculateInstanceTransform(input);
|
||||||
|
output.Geometry.WorldPosition = mul(float4(position, 1), world).xyz;
|
||||||
#if PER_BONE_MOTION_BLUR
|
#if PER_BONE_MOTION_BLUR
|
||||||
float3 prevPosition = SkinPrevPosition(input);
|
float3 prevPosition = SkinPrevPosition(input);
|
||||||
output.Geometry.PrevWorldPosition = mul(float4(prevPosition, 1), object.PrevWorldMatrix).xyz;
|
output.Geometry.PrevWorldPosition = mul(float4(prevPosition, 1), ToMatrix4x4(PrevWorldMatrix)).xyz;
|
||||||
#else
|
#else
|
||||||
output.Geometry.PrevWorldPosition = mul(float4(position, 1), object.PrevWorldMatrix).xyz;
|
output.Geometry.PrevWorldPosition = mul(float4(position, 1), ToMatrix4x4(PrevWorldMatrix)).xyz;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Compute clip space position
|
// Compute clip space position
|
||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
|
|
||||||
// Pass vertex attributes
|
// Pass vertex attributes
|
||||||
output.Geometry.TexCoords01 = float4(input.TexCoord0, input.TexCoord1);
|
output.Geometry.TexCoord = input.TexCoord;
|
||||||
output.Geometry.TexCoords23 = float4(input.TexCoord2, input.TexCoord3);
|
|
||||||
#if USE_VERTEX_COLOR
|
#if USE_VERTEX_COLOR
|
||||||
output.Geometry.VertexColor = input.Color;
|
output.Geometry.VertexColor = float4(0, 0, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
output.Geometry.LightmapUV = float2(0, 0);
|
output.Geometry.LightmapUV = float2(0, 0);
|
||||||
|
output.Geometry.InstanceOrigin = world[3].xyz;
|
||||||
|
#if USE_INSTANCING
|
||||||
|
output.Geometry.InstanceParams = float2(input.InstanceOrigin.w, input.InstanceTransform1.w);
|
||||||
|
#else
|
||||||
|
output.Geometry.InstanceParams = float2(PerInstanceRandom, LODDitherFactor);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Calculate tanget space to world space transformation matrix for unit vectors
|
// Calculate tanget space to world space transformation matrix for unit vectors
|
||||||
float3x3 tangentToWorld = CalcTangentToWorld(object.WorldMatrix, tangentToLocal);
|
float3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||||
output.Geometry.WorldNormal = tangentToWorld[2];
|
output.Geometry.WorldNormal = tangentToWorld[2];
|
||||||
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
||||||
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
||||||
@@ -537,18 +538,16 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
|||||||
// Get material input params if need to evaluate any material property
|
// Get material input params if need to evaluate any material property
|
||||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
||||||
materialInput.TwoSidedSign = object.WorldDeterminantSign;
|
materialInput.TwoSidedSign = WorldDeterminantSign;
|
||||||
materialInput.SvPosition = output.Position;
|
materialInput.SvPosition = output.Position;
|
||||||
materialInput.PreSkinnedPosition = input.Position.xyz;
|
materialInput.PreSkinnedPosition = input.Position.xyz;
|
||||||
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
||||||
materialInput.Object = object;
|
|
||||||
Material material = GetMaterialVS(materialInput);
|
Material material = GetMaterialVS(materialInput);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Apply world position offset per-vertex
|
// Apply world position offset per-vertex
|
||||||
#if USE_POSITION_OFFSET
|
#if USE_POSITION_OFFSET
|
||||||
output.Geometry.WorldPosition += material.PositionOffset;
|
output.Geometry.WorldPosition += material.PositionOffset;
|
||||||
output.Geometry.PrevWorldPosition += material.PositionOffset;
|
|
||||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -569,12 +568,12 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
|||||||
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
|
|
||||||
void ClipLODTransition(MaterialInput input)
|
void ClipLODTransition(PixelInput input)
|
||||||
{
|
{
|
||||||
float ditherFactor = input.Object.LODDitherFactor;
|
float ditherFactor = input.Geometry.InstanceParams.y;
|
||||||
if (abs(ditherFactor) > 0.001)
|
if (abs(ditherFactor) > 0.001)
|
||||||
{
|
{
|
||||||
float randGrid = cos(dot(floor(input.SvPosition.xy), float2(347.83452793, 3343.28371863)));
|
float randGrid = cos(dot(floor(input.Position.xy), float2(347.83452793, 3343.28371863)));
|
||||||
float randGridFrac = frac(randGrid * 1000.0);
|
float randGridFrac = frac(randGrid * 1000.0);
|
||||||
half mask = (ditherFactor < 0.0) ? (ditherFactor + 1.0 > randGridFrac) : (ditherFactor < randGridFrac);
|
half mask = (ditherFactor < 0.0) ? (ditherFactor + 1.0 > randGridFrac) : (ditherFactor < randGridFrac);
|
||||||
clip(mask - 0.001);
|
clip(mask - 0.001);
|
||||||
@@ -587,13 +586,14 @@ void ClipLODTransition(MaterialInput input)
|
|||||||
META_PS(true, FEATURE_LEVEL_ES2)
|
META_PS(true, FEATURE_LEVEL_ES2)
|
||||||
void PS_Depth(PixelInput input)
|
void PS_Depth(PixelInput input)
|
||||||
{
|
{
|
||||||
MaterialInput materialInput = GetMaterialInput(input);
|
|
||||||
#if USE_DITHERED_LOD_TRANSITION
|
#if USE_DITHERED_LOD_TRANSITION
|
||||||
ClipLODTransition(materialInput);
|
// LOD masking
|
||||||
|
ClipLODTransition(input);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MATERIAL_MASKED || MATERIAL_BLEND != MATERIAL_BLEND_OPAQUE
|
#if MATERIAL_MASKED || MATERIAL_BLEND != MATERIAL_BLEND_OPAQUE
|
||||||
// Get material parameters
|
// Get material parameters
|
||||||
|
MaterialInput materialInput = GetMaterialInput(input);
|
||||||
Material material = GetMaterialPS(materialInput);
|
Material material = GetMaterialPS(materialInput);
|
||||||
|
|
||||||
// Perform per pixel clipping
|
// Perform per pixel clipping
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#define MATERIAL 1
|
#define MATERIAL 1
|
||||||
#define USE_PER_VIEW_CONSTANTS 1
|
#define USE_PER_VIEW_CONSTANTS 1
|
||||||
#define LoadObjectFromCB(var) var = GetObject()
|
|
||||||
@3
|
@3
|
||||||
// Enables/disables smooth terrain chunks LOD transitions (with morphing higher LOD near edges to the lower LOD in the neighbour)
|
// Enables/disables smooth terrain chunks LOD transitions (with morphing higher LOD near edges to the lower LOD in the neighbour)
|
||||||
#define USE_SMOOTH_LOD_TRANSITION 1
|
#define USE_SMOOTH_LOD_TRANSITION 1
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
#include "./Flax/Common.hlsl"
|
#include "./Flax/Common.hlsl"
|
||||||
#include "./Flax/MaterialCommon.hlsl"
|
#include "./Flax/MaterialCommon.hlsl"
|
||||||
#include "./Flax/GBufferCommon.hlsl"
|
#include "./Flax/GBufferCommon.hlsl"
|
||||||
#include "./Flax/TerrainCommon.hlsl"
|
|
||||||
@7
|
@7
|
||||||
// Primary constant buffer (with additional material parameters)
|
// Primary constant buffer (with additional material parameters)
|
||||||
META_CB_BEGIN(0, Data)
|
META_CB_BEGIN(0, Data)
|
||||||
@@ -30,7 +28,6 @@ float4 HeightmapUVScaleBias;
|
|||||||
float4 NeighborLOD;
|
float4 NeighborLOD;
|
||||||
float2 OffsetUV;
|
float2 OffsetUV;
|
||||||
float2 Dummy0;
|
float2 Dummy0;
|
||||||
float4 LightmapArea;
|
|
||||||
@1META_CB_END
|
@1META_CB_END
|
||||||
|
|
||||||
// Terrain data
|
// Terrain data
|
||||||
@@ -91,7 +88,6 @@ struct MaterialInput
|
|||||||
float3 PreSkinnedPosition;
|
float3 PreSkinnedPosition;
|
||||||
float3 PreSkinnedNormal;
|
float3 PreSkinnedNormal;
|
||||||
float HolesMask;
|
float HolesMask;
|
||||||
ObjectData Object;
|
|
||||||
#if USE_TERRAIN_LAYERS
|
#if USE_TERRAIN_LAYERS
|
||||||
float4 Layers[TERRAIN_LAYERS_DATA_SIZE];
|
float4 Layers[TERRAIN_LAYERS_DATA_SIZE];
|
||||||
#endif
|
#endif
|
||||||
@@ -151,23 +147,9 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ObjectData GetObject()
|
|
||||||
{
|
|
||||||
ObjectData object = (ObjectData)0;
|
|
||||||
object.WorldMatrix = ToMatrix4x4(WorldMatrix);
|
|
||||||
object.PrevWorldMatrix = object.WorldMatrix;
|
|
||||||
object.GeometrySize = float3(1, 1, 1);
|
|
||||||
object.PerInstanceRandom = PerInstanceRandom;
|
|
||||||
object.WorldDeterminantSign = WorldDeterminantSign;
|
|
||||||
object.LODDitherFactor = 0.0f;
|
|
||||||
object.LightmapArea = LightmapArea;
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialInput GetMaterialInput(PixelInput input)
|
MaterialInput GetMaterialInput(PixelInput input)
|
||||||
{
|
{
|
||||||
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
||||||
output.Object = GetObject();
|
|
||||||
output.TwoSidedSign = WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
output.TwoSidedSign = WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
||||||
output.SvPosition = input.Position;
|
output.SvPosition = input.Position;
|
||||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
@@ -237,12 +219,6 @@ float3 GetObjectSize(MaterialInput input)
|
|||||||
return float3(1, 1, 1);
|
return float3(1, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets the current object scale (supports instancing)
|
|
||||||
float3 GetObjectScale(MaterialInput input)
|
|
||||||
{
|
|
||||||
return float3(1, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current object random value
|
// Get the current object random value
|
||||||
float GetPerInstanceRandom(MaterialInput input)
|
float GetPerInstanceRandom(MaterialInput input)
|
||||||
{
|
{
|
||||||
@@ -326,6 +302,8 @@ struct TerrainVertexInput
|
|||||||
|
|
||||||
// Vertex Shader function for terrain rendering
|
// Vertex Shader function for terrain rendering
|
||||||
META_VS(true, FEATURE_LEVEL_ES2)
|
META_VS(true, FEATURE_LEVEL_ES2)
|
||||||
|
META_VS_IN_ELEMENT(TEXCOORD, 0, R32G32_FLOAT, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
|
META_VS_IN_ELEMENT(TEXCOORD, 1, R8G8B8A8_UNORM, 0, ALIGN, PER_VERTEX, 0, true)
|
||||||
VertexOutput VS(TerrainVertexInput input)
|
VertexOutput VS(TerrainVertexInput input)
|
||||||
{
|
{
|
||||||
VertexOutput output;
|
VertexOutput output;
|
||||||
@@ -335,7 +313,7 @@ VertexOutput VS(TerrainVertexInput input)
|
|||||||
float lodValue = CurrentLOD;
|
float lodValue = CurrentLOD;
|
||||||
float morphAlpha = lodCalculated - CurrentLOD;
|
float morphAlpha = lodCalculated - CurrentLOD;
|
||||||
|
|
||||||
// Sample heightmap and splatmaps
|
// Sample heightmap
|
||||||
float2 heightmapUVs = input.TexCoord * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
float2 heightmapUVs = input.TexCoord * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
||||||
#if USE_SMOOTH_LOD_TRANSITION
|
#if USE_SMOOTH_LOD_TRANSITION
|
||||||
float4 heightmapValueThisLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
float4 heightmapValueThisLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||||
@@ -343,6 +321,7 @@ VertexOutput VS(TerrainVertexInput input)
|
|||||||
float2 heightmapUVsNextLOD = nextLODPos * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
float2 heightmapUVsNextLOD = nextLODPos * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
||||||
float4 heightmapValueNextLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
float4 heightmapValueNextLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
||||||
float4 heightmapValue = lerp(heightmapValueThisLOD, heightmapValueNextLOD, morphAlpha);
|
float4 heightmapValue = lerp(heightmapValueThisLOD, heightmapValueNextLOD, morphAlpha);
|
||||||
|
bool isHole = max(heightmapValueThisLOD.b + heightmapValueThisLOD.a, heightmapValueNextLOD.b + heightmapValueNextLOD.a) >= 1.9f;
|
||||||
#if USE_TERRAIN_LAYERS
|
#if USE_TERRAIN_LAYERS
|
||||||
float4 splatmapValueThisLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
float4 splatmapValueThisLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||||
float4 splatmapValueNextLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
float4 splatmapValueNextLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
||||||
@@ -355,6 +334,7 @@ VertexOutput VS(TerrainVertexInput input)
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
float4 heightmapValue = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
float4 heightmapValue = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||||
|
bool isHole = (heightmapValue.b + heightmapValue.a) >= 1.9f;
|
||||||
#if USE_TERRAIN_LAYERS
|
#if USE_TERRAIN_LAYERS
|
||||||
float4 splatmap0Value = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
float4 splatmap0Value = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||||
#if TERRAIN_LAYERS_DATA_SIZE > 1
|
#if TERRAIN_LAYERS_DATA_SIZE > 1
|
||||||
@@ -362,11 +342,12 @@ VertexOutput VS(TerrainVertexInput input)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
float height = DecodeHeightmapHeight(heightmapValue);
|
float height = (float)((int)(heightmapValue.x * 255.0) + ((int)(heightmapValue.y * 255) << 8)) / 65535.0;
|
||||||
|
|
||||||
// Extract normal and the holes mask
|
// Extract normal and the holes mask
|
||||||
bool isHole;
|
float2 normalTemp = float2(heightmapValue.b, heightmapValue.a) * 2.0f - 1.0f;
|
||||||
float3 normal = DecodeHeightmapNormal(heightmapValue, isHole);
|
float3 normal = float3(normalTemp.x, sqrt(1.0 - saturate(dot(normalTemp, normalTemp))), normalTemp.y);
|
||||||
|
normal = normalize(normal);
|
||||||
output.Geometry.HolesMask = isHole ? 0 : 1;
|
output.Geometry.HolesMask = isHole ? 0 : 1;
|
||||||
if (isHole)
|
if (isHole)
|
||||||
{
|
{
|
||||||
@@ -415,7 +396,6 @@ VertexOutput VS(TerrainVertexInput input)
|
|||||||
// Get material input params if need to evaluate any material property
|
// Get material input params if need to evaluate any material property
|
||||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||||
MaterialInput materialInput = (MaterialInput)0;
|
MaterialInput materialInput = (MaterialInput)0;
|
||||||
materialInput.Object = GetObject();
|
|
||||||
materialInput.WorldPosition = output.Geometry.WorldPosition;
|
materialInput.WorldPosition = output.Geometry.WorldPosition;
|
||||||
materialInput.TexCoord = output.Geometry.TexCoord;
|
materialInput.TexCoord = output.Geometry.TexCoord;
|
||||||
#if USE_LIGHTMAP
|
#if USE_LIGHTMAP
|
||||||
|
|||||||
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.
@@ -1,19 +0,0 @@
|
|||||||
%copyright%#include "%filename%.h"
|
|
||||||
|
|
||||||
%class%::%class%(const SpawnParams& params)
|
|
||||||
: Actor(params)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void %class%::OnEnable()
|
|
||||||
{
|
|
||||||
Actor::OnEnable();
|
|
||||||
// Here you can add code that needs to be called when script is enabled (eg. register for events)
|
|
||||||
}
|
|
||||||
|
|
||||||
void %class%::OnDisable()
|
|
||||||
{
|
|
||||||
Actor::OnDisable();
|
|
||||||
// Here you can add code that needs to be called when script is disabled (eg. unregister from events)
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// %class% Actor.
|
|
||||||
/// </summary>
|
|
||||||
public class %class% : Actor
|
|
||||||
{
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void OnBeginPlay()
|
|
||||||
{
|
|
||||||
base.OnBeginPlay();
|
|
||||||
// Here you can add code that needs to be called when Actor added to the game. This is called during edit time as well.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void OnEndPlay()
|
|
||||||
{
|
|
||||||
base.OnEndPlay();
|
|
||||||
// Here you can add code that needs to be called when Actor removed to the game. This is called during edit time as well.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void OnEnable()
|
|
||||||
{
|
|
||||||
base.OnEnable();
|
|
||||||
// Here you can add code that needs to be called when Actor is enabled (eg. register for events). This is called during edit time as well.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void OnDisable()
|
|
||||||
{
|
|
||||||
base.OnDisable();
|
|
||||||
// Here you can add code that needs to be called when Actor is disabled (eg. unregister from events). This is called during edit time as well.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
%copyright%#pragma once
|
|
||||||
|
|
||||||
#include "Engine/Level/Actor.h"
|
|
||||||
|
|
||||||
API_CLASS() class %module%%class% : public Actor
|
|
||||||
{
|
|
||||||
API_AUTO_SERIALIZATION();
|
|
||||||
DECLARE_SCENE_OBJECT(%class%);
|
|
||||||
|
|
||||||
// [Actor]
|
|
||||||
void OnEnable() override;
|
|
||||||
void OnDisable() override;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
@@ -13,10 +13,10 @@ API_CLASS() class %module%%class% : public ISerializable
|
|||||||
API_AUTO_SERIALIZATION();
|
API_AUTO_SERIALIZATION();
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(%class%);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(%class%);
|
||||||
public:
|
public:
|
||||||
// Custom float value.
|
// Custom float value.
|
||||||
API_FIELD(Attributes = "Range(0, 20), EditorOrder(0), EditorDisplay(\"Data\")")
|
API_FIELD(Attributes = "Range(0, 20), EditorOrder(0), EditorDisplay(\"Data\")")
|
||||||
float FloatValue = 20.0f;
|
float FloatValue = 20.0f;
|
||||||
// Custom vector data.
|
// Custom vector data.
|
||||||
API_FIELD(Attributes = "EditorOrder(1), EditorDisplay(\"Data\")")
|
API_FIELD(Attributes = "EditorOrder(1), EditorDisplay(\"Data\")")
|
||||||
Vector3 Vector3Value = Vector3(0.1f);
|
Vector3 Vector3Value = Vector3(0.1f);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// %class% class.
|
|
||||||
/// </summary>
|
|
||||||
public class %class%
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// %class% interface.
|
|
||||||
/// </summary>
|
|
||||||
public interface %class%
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// %class% struct.
|
|
||||||
/// </summary>
|
|
||||||
public struct %class%
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
%copyright%using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using FlaxEngine;
|
|
||||||
|
|
||||||
namespace %namespace%;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// %class% GamePlugin.
|
|
||||||
/// </summary>
|
|
||||||
public class %class% : GamePlugin
|
|
||||||
{
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public override void Deinitialize()
|
|
||||||
{
|
|
||||||
base.Deinitialize();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,6 +7,6 @@ META_CB_END
|
|||||||
META_PS(true, FEATURE_LEVEL_ES2)
|
META_PS(true, FEATURE_LEVEL_ES2)
|
||||||
float4 PS_Fullscreen(Quad_VS2PS input) : SV_Target
|
float4 PS_Fullscreen(Quad_VS2PS input) : SV_Target
|
||||||
{
|
{
|
||||||
// Solid color fill from the constant buffer passed from code
|
// Solid color fill from the constant buffer passed from code
|
||||||
return Color;
|
return Color;
|
||||||
}
|
}
|
||||||
|
|||||||
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
Content/Engine/Models/Box.flax
LFS
BIN
Content/Engine/Models/Box.flax
LFS
Binary file not shown.
BIN
Content/Engine/Models/Quad.flax
LFS
BIN
Content/Engine/Models/Quad.flax
LFS
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user