Compare commits
19 Commits
wip
...
signalgame
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f265bddf4 | |||
| 3237849132 | |||
| 2be4d2b717 | |||
| dc3a1e142a | |||
| b6d375e9a3 | |||
| 495b6d6abc | |||
| a49b398c7f | |||
| c8e893d2ec | |||
| 3a665199e7 | |||
| ca1aa89ba1 | |||
| d92aaeb2b0 | |||
| 5f950cbb7e | |||
| 8f613774cb | |||
| c5c440469e | |||
| 1e6ed32c63 | |||
| 3ee6bffef7 | |||
| 6105323ecc | |||
| 23f8707927 | |||
| 761c8415dc |
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:
|
||||
vulkan-version:
|
||||
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
|
||||
default: '1.3.290.0'
|
||||
default: '1.2.198.1'
|
||||
required: false
|
||||
runs:
|
||||
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-windows:
|
||||
name: Game (iOS, Release ARM64)
|
||||
runs-on: "macos-14"
|
||||
runs-on: "macos-latest"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
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-linux:
|
||||
name: Editor (Linux, Development x64)
|
||||
runs-on: "ubuntu-24.04"
|
||||
runs-on: "ubuntu-20.04"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
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
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -38,13 +41,13 @@ jobs:
|
||||
# Game
|
||||
game-linux:
|
||||
name: Game (Linux, Release x64)
|
||||
runs-on: "ubuntu-24.04"
|
||||
runs-on: "ubuntu-20.04"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
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
|
||||
uses: ./.github/actions/vulkan
|
||||
- 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-mac:
|
||||
name: Editor (Mac, Development ARM64)
|
||||
runs-on: "macos-14"
|
||||
runs-on: "macos-latest"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
# Game
|
||||
game-mac:
|
||||
name: Game (Mac, Release ARM64)
|
||||
runs-on: "macos-14"
|
||||
runs-on: "macos-latest"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
43
.github/workflows/cd.yml
vendored
43
.github/workflows/cd.yml
vendored
@@ -1,13 +1,12 @@
|
||||
name: Continuous Deployment
|
||||
on:
|
||||
schedule:
|
||||
- cron: '15 6 * * *'
|
||||
- cron: '15 4 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOTNET_NOLOGO: true
|
||||
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:
|
||||
|
||||
@@ -21,7 +20,7 @@ jobs:
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -36,12 +35,12 @@ jobs:
|
||||
run: |
|
||||
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows-Editor
|
||||
path: Output/Editor.zip
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows-EditorDebugSymbols
|
||||
path: Output/EditorDebugSymbols.zip
|
||||
@@ -54,7 +53,7 @@ jobs:
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -69,7 +68,7 @@ jobs:
|
||||
run: |
|
||||
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows-Game
|
||||
path: Output/Windows.zip
|
||||
@@ -77,16 +76,19 @@ jobs:
|
||||
# Linux
|
||||
package-linux-editor:
|
||||
name: Editor (Linux)
|
||||
runs-on: "ubuntu-24.04"
|
||||
runs-on: "ubuntu-20.04"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/*
|
||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
@@ -102,22 +104,25 @@ jobs:
|
||||
run: |
|
||||
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux-Editor
|
||||
path: Output/FlaxEditorLinux.zip
|
||||
package-linux-game:
|
||||
name: Game (Linux)
|
||||
runs-on: "ubuntu-24.04"
|
||||
runs-on: "ubuntu-20.04"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/*
|
||||
sudo cp -f .github/workflows/build_linux_sources.list /etc/apt/sources.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
@@ -133,7 +138,7 @@ jobs:
|
||||
run: |
|
||||
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux-Game
|
||||
path: Output/Linux.zip
|
||||
@@ -141,14 +146,14 @@ jobs:
|
||||
# Mac
|
||||
package-mac-editor:
|
||||
name: Editor (Mac)
|
||||
runs-on: "macos-14"
|
||||
runs-on: "macos-latest"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -163,20 +168,20 @@ jobs:
|
||||
run: |
|
||||
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Mac-Editor
|
||||
path: Output/FlaxEditorMac.zip
|
||||
package-mac-game:
|
||||
name: Game (Mac)
|
||||
runs-on: "macos-14"
|
||||
runs-on: "macos-latest"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
git lfs version
|
||||
git ${{ env.GIT_LFS_PULL_OPTIONS }} lfs pull
|
||||
git lfs pull
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -191,7 +196,7 @@ jobs:
|
||||
run: |
|
||||
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Mac-Game
|
||||
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"
|
||||
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
# Tests on Linux
|
||||
tests-linux:
|
||||
name: Tests (Linux)
|
||||
runs-on: "ubuntu-24.04"
|
||||
runs-on: "ubuntu-20.04"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
@@ -28,7 +28,10 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Install dependencies
|
||||
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
|
||||
run: |
|
||||
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
|
||||
|
||||
BIN
Content/Editor/Camera/M_Camera.flax
(Stored with Git LFS)
BIN
Content/Editor/Camera/M_Camera.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/CubeTexturePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/CubeTexturePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/DDGIDebugProbes.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/DDGIDebugProbes.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Decal.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Decal.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Particle.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Particle.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Surface.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Surface.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Terrain.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Terrain.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DefaultFontMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/DefaultFontMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/FoliageBrushMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/FoliageBrushMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisFocus.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisFocus.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisLocked.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisLocked.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisX.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisX.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisY.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisY.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisZ.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisZ.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialSphere.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialSphere.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialWire.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialWire.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/SelectionOutlineMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/SelectionOutlineMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Highlight Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Highlight Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Icons/IconsMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Icons/IconsMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/IesProfilePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/IesProfilePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
@@ -26,12 +26,14 @@ void PS_GBuffer(
|
||||
)
|
||||
{
|
||||
Light = float4(0, 0, 0, 1);
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
|
||||
#if USE_DITHERED_LOD_TRANSITION
|
||||
ClipLODTransition(materialInput);
|
||||
// LOD masking
|
||||
ClipLODTransition(input);
|
||||
#endif
|
||||
|
||||
// Get material parameters
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
Material material = GetMaterialPS(materialInput);
|
||||
|
||||
// Masking
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
META_PS(USE_DISTORTION, FEATURE_LEVEL_ES2)
|
||||
float4 PS_Distortion(PixelInput input) : SV_Target0
|
||||
{
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
#if USE_DITHERED_LOD_TRANSITION
|
||||
ClipLODTransition(materialInput);
|
||||
// LOD masking
|
||||
ClipLODTransition(input);
|
||||
#endif
|
||||
|
||||
// Get material parameters
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
Material material = GetMaterialPS(materialInput);
|
||||
|
||||
// Masking
|
||||
|
||||
@@ -38,12 +38,14 @@ void PS_Forward(
|
||||
)
|
||||
{
|
||||
output = 0;
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
|
||||
#if USE_DITHERED_LOD_TRANSITION
|
||||
ClipLODTransition(materialInput);
|
||||
// LOD masking
|
||||
ClipLODTransition(input);
|
||||
#endif
|
||||
|
||||
// Get material parameters
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
Material material = GetMaterialPS(materialInput);
|
||||
|
||||
// Masking
|
||||
@@ -119,20 +121,6 @@ void PS_Forward(
|
||||
float3 screenColor = sceneColorTexture.SampleLevel(SamplerPointClamp, hit.xy, 0).rgb;
|
||||
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
|
||||
|
||||
light.rgb += reflections * GetReflectionSpecularLighting(ViewPos, gBuffer) * light.a;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define CAN_USE_LIGHTMAP 1
|
||||
@1// Lightmap: Includes
|
||||
@2// Lightmap: Constants
|
||||
float4 LightmapArea;
|
||||
@3// Lightmap: Resources
|
||||
#if USE_LIGHTMAP
|
||||
// Irradiance and directionality prebaked lightmaps
|
||||
|
||||
@@ -11,15 +11,14 @@
|
||||
META_PS(true, FEATURE_LEVEL_ES2)
|
||||
float4 PS_MotionVectors(PixelInput input) : SV_Target0
|
||||
{
|
||||
#if USE_DITHERED_LOD_TRANSITION || MATERIAL_MASKED
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
#if USE_DITHERED_LOD_TRANSITION
|
||||
ClipLODTransition(materialInput);
|
||||
#endif
|
||||
// LOD masking
|
||||
ClipLODTransition(input);
|
||||
#endif
|
||||
|
||||
#if MATERIAL_MASKED
|
||||
// Perform per pixel clipping if material requries it
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
Material material = GetMaterialPS(materialInput);
|
||||
clip(material.Mask - MATERIAL_MASK_THRESHOLD);
|
||||
#endif
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright (c) 2012-2024 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
|
||||
@@ -33,13 +33,8 @@ struct TessalationDSToPS
|
||||
MaterialInput GetMaterialInput(TessalationDSToPS input)
|
||||
{
|
||||
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.TwoSidedSign = output.Object.WorldDeterminantSign;
|
||||
output.TwoSidedSign = WorldDeterminantSign;
|
||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
output.CustomVSToPS = input.CustomVSToPS;
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#define MATERIAL 1
|
||||
#define USE_PER_VIEW_CONSTANTS 1
|
||||
#define USE_PER_DRAW_CONSTANTS 1
|
||||
@3
|
||||
#include "./Flax/Common.hlsl"
|
||||
#include "./Flax/MaterialCommon.hlsl"
|
||||
@@ -11,19 +10,17 @@
|
||||
@7
|
||||
// Primary constant buffer (with additional material parameters)
|
||||
META_CB_BEGIN(0, Data)
|
||||
float4x3 WorldMatrix;
|
||||
float4x3 PrevWorldMatrix;
|
||||
float2 Dummy0;
|
||||
float LODDitherFactor;
|
||||
float PerInstanceRandom;
|
||||
float3 GeometrySize;
|
||||
float WorldDeterminantSign;
|
||||
@1META_CB_END
|
||||
|
||||
// Shader resources
|
||||
@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
|
||||
struct GeometryData
|
||||
{
|
||||
@@ -35,8 +32,12 @@ struct GeometryData
|
||||
#endif
|
||||
float3 WorldNormal : TEXCOORD3;
|
||||
float4 WorldTangent : TEXCOORD4;
|
||||
nointerpolation float3 InstanceOrigin : TEXCOORD5;
|
||||
nointerpolation float2 InstanceParams : TEXCOORD6; // x-PerInstanceRandom, y-LODDitherFactor
|
||||
float3 PrevWorldPosition : TEXCOORD7;
|
||||
nointerpolation uint ObjectIndex : TEXCOORD8;
|
||||
nointerpolation float3 InstanceTransform1 : TEXCOORD8;
|
||||
nointerpolation float3 InstanceTransform2 : TEXCOORD9;
|
||||
nointerpolation float3 InstanceTransform3 : TEXCOORD10;
|
||||
};
|
||||
|
||||
// Interpolants passed from the vertex shader
|
||||
@@ -79,8 +80,11 @@ struct MaterialInput
|
||||
float4 SvPosition;
|
||||
float3 PreSkinnedPosition;
|
||||
float3 PreSkinnedNormal;
|
||||
uint ObjectIndex;
|
||||
ObjectData Object;
|
||||
float3 InstanceOrigin;
|
||||
float2 InstanceParams;
|
||||
float3 InstanceTransform1;
|
||||
float3 InstanceTransform2;
|
||||
float3 InstanceTransform3;
|
||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
float4 CustomVSToPS[CUSTOM_VERTEX_INTERPOLATORS_COUNT];
|
||||
#endif
|
||||
@@ -99,7 +103,11 @@ MaterialInput GetGeometryMaterialInput(GeometryData geometry)
|
||||
output.VertexColor = geometry.VertexColor;
|
||||
#endif
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -135,7 +143,11 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
||||
output.WorldNormal = normalize(output.WorldNormal);
|
||||
output.WorldTangent = p0.WorldTangent * w0 + p1.WorldTangent * w1 + p2.WorldTangent * w2;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -144,8 +156,7 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
||||
MaterialInput GetMaterialInput(PixelInput input)
|
||||
{
|
||||
MaterialInput output = GetGeometryMaterialInput(input.Geometry);
|
||||
output.Object = LoadObject(ObjectsBuffer, input.Geometry.ObjectIndex);
|
||||
output.TwoSidedSign = output.Object.WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
||||
output.TwoSidedSign = WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
||||
output.SvPosition = input.Position;
|
||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
output.CustomVSToPS = input.CustomVSToPS;
|
||||
@@ -153,6 +164,16 @@ MaterialInput GetMaterialInput(PixelInput input)
|
||||
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)
|
||||
float3x3 RemoveScaleFromLocalToWorld(float3x3 localToWorld)
|
||||
{
|
||||
@@ -197,7 +218,7 @@ float3 TransformViewVectorToWorld(MaterialInput input, float3 viewVector)
|
||||
// Transforms a vector from local space to world space
|
||||
float3 TransformLocalVectorToWorld(MaterialInput input, float3 localVector)
|
||||
{
|
||||
float3x3 localToWorld = (float3x3)input.Object.WorldMatrix;
|
||||
float3x3 localToWorld = (float3x3)GetInstanceTransform(input);
|
||||
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
||||
return mul(localVector, localToWorld);
|
||||
}
|
||||
@@ -205,7 +226,7 @@ float3 TransformLocalVectorToWorld(MaterialInput input, float3 localVector)
|
||||
// Transforms a vector from local space to world space
|
||||
float3 TransformWorldVectorToLocal(MaterialInput input, float3 worldVector)
|
||||
{
|
||||
float3x3 localToWorld = (float3x3)input.Object.WorldMatrix;
|
||||
float3x3 localToWorld = (float3x3)GetInstanceTransform(input);
|
||||
//localToWorld = RemoveScaleFromLocalToWorld(localToWorld);
|
||||
return mul(localToWorld, worldVector);
|
||||
}
|
||||
@@ -213,26 +234,30 @@ float3 TransformWorldVectorToLocal(MaterialInput input, float3 worldVector)
|
||||
// Gets the current object position (supports instancing)
|
||||
float3 GetObjectPosition(MaterialInput input)
|
||||
{
|
||||
return input.Object.WorldMatrix[3].xyz;
|
||||
return input.InstanceOrigin.xyz;
|
||||
}
|
||||
|
||||
// Gets the current object size (supports instancing)
|
||||
float3 GetObjectSize(MaterialInput input)
|
||||
{
|
||||
float4x4 world = input.Object.WorldMatrix;
|
||||
return input.Object.GeometrySize * float3(world._m00, world._m11, world._m22);
|
||||
float4x4 world = GetInstanceTransform(input);
|
||||
return GeometrySize * float3(world._m00, world._m11, world._m22);
|
||||
}
|
||||
|
||||
// Get the current object random value (supports instancing)
|
||||
float GetPerInstanceRandom(MaterialInput input)
|
||||
{
|
||||
return input.Object.PerInstanceRandom;
|
||||
return input.InstanceParams.x;
|
||||
}
|
||||
|
||||
// Get the current object LOD transition dither factor (supports instancing)
|
||||
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)
|
||||
@@ -291,22 +316,19 @@ 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(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(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 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
|
||||
output.Geometry.WorldPosition = mul(float4(input.Position.xyz, 1), object.WorldMatrix).xyz;
|
||||
output.Geometry.PrevWorldPosition = mul(float4(input.Position.xyz, 1), object.PrevWorldMatrix).xyz;
|
||||
CalculateInstanceTransform(input);
|
||||
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
|
||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||
@@ -316,15 +338,22 @@ VertexOutput VS(ModelInput input)
|
||||
#if USE_VERTEX_COLOR
|
||||
output.Geometry.VertexColor = input.Color;
|
||||
#endif
|
||||
output.Geometry.InstanceOrigin = world[3].xyz;
|
||||
#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
|
||||
#if CAN_USE_LIGHTMAP
|
||||
output.Geometry.LightmapUV = input.LightmapUV * object.LightmapArea.zw + object.LightmapArea.xy;
|
||||
output.Geometry.LightmapUV = input.LightmapUV * LightmapArea.zw + LightmapArea.xy;
|
||||
#else
|
||||
output.Geometry.LightmapUV = input.LightmapUV;
|
||||
#endif
|
||||
output.Geometry.InstanceParams = float2(PerInstanceRandom, LODDitherFactor);
|
||||
#endif
|
||||
|
||||
// Calculate tanget space to world space transformation matrix for unit vectors
|
||||
float3x3 tangentToLocal = CalcTangentToLocal(input);
|
||||
float3x3 tangentToWorld = CalcTangentToWorld(object.WorldMatrix, tangentToLocal);
|
||||
float3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||
output.Geometry.WorldNormal = tangentToWorld[2];
|
||||
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
||||
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
||||
@@ -332,11 +361,10 @@ VertexOutput VS(ModelInput input)
|
||||
// Get material input params if need to evaluate any material property
|
||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
||||
materialInput.TwoSidedSign = object.WorldDeterminantSign;
|
||||
materialInput.TwoSidedSign = WorldDeterminantSign;
|
||||
materialInput.SvPosition = output.Position;
|
||||
materialInput.PreSkinnedPosition = input.Position.xyz;
|
||||
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
||||
materialInput.Object = object;
|
||||
Material material = GetMaterialVS(materialInput);
|
||||
#endif
|
||||
|
||||
@@ -364,27 +392,33 @@ META_VS(true, FEATURE_LEVEL_ES2)
|
||||
META_PERMUTATION_1(USE_INSTANCING=0)
|
||||
META_PERMUTATION_1(USE_INSTANCING=1)
|
||||
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
|
||||
{
|
||||
// Load object data
|
||||
#if USE_INSTANCING
|
||||
uint objectIndex = input.ObjectIndex;
|
||||
float4x4 world = GetInstanceTransform(input);
|
||||
#else
|
||||
uint objectIndex = DrawObjectIndex;
|
||||
float4x4 world = ToMatrix4x4(WorldMatrix);
|
||||
#endif
|
||||
ObjectData object = LoadObject(ObjectsBuffer, objectIndex);
|
||||
|
||||
// Transform vertex position into the screen
|
||||
float3 worldPosition = mul(float4(input.Position.xyz, 1), object.WorldMatrix).xyz;
|
||||
float3 worldPosition = mul(float4(input.Position.xyz, 1), world).xyz;
|
||||
float4 position = mul(float4(worldPosition, 1), ViewProjectionMatrix);
|
||||
return position;
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
// The skeletal bones matrix buffer from the previous frame
|
||||
Buffer<float4> PrevBoneMatrices : register(t1);
|
||||
|
||||
float3x4 GetPrevBoneMatrix(int index)
|
||||
{
|
||||
float4 a = PrevBoneMatrices[index * 3];
|
||||
@@ -463,10 +497,6 @@ META_VS_IN_ELEMENT(BLENDWEIGHT, 0, R16G16B16A16_FLOAT,0, ALIGN, PER_VERTEX, 0,
|
||||
VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||
{
|
||||
VertexOutput output;
|
||||
|
||||
// Load object data
|
||||
output.Geometry.ObjectIndex = DrawObjectIndex;
|
||||
ObjectData object = LoadObject(ObjectsBuffer, output.Geometry.ObjectIndex);
|
||||
|
||||
// Perform skinning
|
||||
float3x4 boneMatrix = GetBoneMatrix(input);
|
||||
@@ -474,12 +504,13 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||
float3x3 tangentToLocal = SkinTangents(input, boneMatrix);
|
||||
|
||||
// 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
|
||||
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
|
||||
output.Geometry.PrevWorldPosition = mul(float4(position, 1), object.PrevWorldMatrix).xyz;
|
||||
output.Geometry.PrevWorldPosition = mul(float4(position, 1), ToMatrix4x4(PrevWorldMatrix)).xyz;
|
||||
#endif
|
||||
|
||||
// Compute clip space position
|
||||
@@ -491,9 +522,15 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||
output.Geometry.VertexColor = float4(0, 0, 0, 1);
|
||||
#endif
|
||||
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
|
||||
float3x3 tangentToWorld = CalcTangentToWorld(object.WorldMatrix, tangentToLocal);
|
||||
float3x3 tangentToWorld = CalcTangentToWorld(world, tangentToLocal);
|
||||
output.Geometry.WorldNormal = tangentToWorld[2];
|
||||
output.Geometry.WorldTangent.xyz = tangentToWorld[0];
|
||||
output.Geometry.WorldTangent.w = input.Tangent.w ? -1.0f : +1.0f;
|
||||
@@ -501,11 +538,10 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||
// Get material input params if need to evaluate any material property
|
||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
MaterialInput materialInput = GetGeometryMaterialInput(output.Geometry);
|
||||
materialInput.TwoSidedSign = object.WorldDeterminantSign;
|
||||
materialInput.TwoSidedSign = WorldDeterminantSign;
|
||||
materialInput.SvPosition = output.Position;
|
||||
materialInput.PreSkinnedPosition = input.Position.xyz;
|
||||
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
||||
materialInput.Object = object;
|
||||
Material material = GetMaterialVS(materialInput);
|
||||
#endif
|
||||
|
||||
@@ -532,12 +568,12 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
|
||||
|
||||
#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)
|
||||
{
|
||||
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);
|
||||
half mask = (ditherFactor < 0.0) ? (ditherFactor + 1.0 > randGridFrac) : (ditherFactor < randGridFrac);
|
||||
clip(mask - 0.001);
|
||||
@@ -550,13 +586,14 @@ void ClipLODTransition(MaterialInput input)
|
||||
META_PS(true, FEATURE_LEVEL_ES2)
|
||||
void PS_Depth(PixelInput input)
|
||||
{
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
#if USE_DITHERED_LOD_TRANSITION
|
||||
ClipLODTransition(materialInput);
|
||||
// LOD masking
|
||||
ClipLODTransition(input);
|
||||
#endif
|
||||
|
||||
#if MATERIAL_MASKED || MATERIAL_BLEND != MATERIAL_BLEND_OPAQUE
|
||||
// Get material parameters
|
||||
MaterialInput materialInput = GetMaterialInput(input);
|
||||
Material material = GetMaterialPS(materialInput);
|
||||
|
||||
// Perform per pixel clipping
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#define MATERIAL 1
|
||||
#define USE_PER_VIEW_CONSTANTS 1
|
||||
#define LoadObjectFromCB(var) var = GetObject()
|
||||
@3
|
||||
// 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
|
||||
@@ -29,7 +28,6 @@ float4 HeightmapUVScaleBias;
|
||||
float4 NeighborLOD;
|
||||
float2 OffsetUV;
|
||||
float2 Dummy0;
|
||||
float4 LightmapArea;
|
||||
@1META_CB_END
|
||||
|
||||
// Terrain data
|
||||
@@ -90,7 +88,6 @@ struct MaterialInput
|
||||
float3 PreSkinnedPosition;
|
||||
float3 PreSkinnedNormal;
|
||||
float HolesMask;
|
||||
ObjectData Object;
|
||||
#if USE_TERRAIN_LAYERS
|
||||
float4 Layers[TERRAIN_LAYERS_DATA_SIZE];
|
||||
#endif
|
||||
@@ -150,23 +147,9 @@ GeometryData InterpolateGeometry(GeometryData p0, float w0, GeometryData p1, flo
|
||||
|
||||
#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 output = GetGeometryMaterialInput(input.Geometry);
|
||||
output.Object = GetObject();
|
||||
output.TwoSidedSign = WorldDeterminantSign * (input.IsFrontFace ? 1.0 : -1.0);
|
||||
output.SvPosition = input.Position;
|
||||
#if USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
@@ -413,7 +396,6 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
// Get material input params if need to evaluate any material property
|
||||
#if USE_POSITION_OFFSET || USE_TESSELLATION || USE_CUSTOM_VERTEX_INTERPOLATORS
|
||||
MaterialInput materialInput = (MaterialInput)0;
|
||||
materialInput.Object = GetObject();
|
||||
materialInput.WorldPosition = output.Geometry.WorldPosition;
|
||||
materialInput.TexCoord = output.Geometry.TexCoord;
|
||||
#if USE_LIGHTMAP
|
||||
|
||||
BIN
Content/Editor/Particles/Particle Material Color.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Particle Material Color.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Particles/Smoke Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Smoke Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Particles/Smoke.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Smoke.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Particles/Sparks.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Sparks.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Primitives/Capsule.flax
(Stored with Git LFS)
BIN
Content/Editor/Primitives/Capsule.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Primitives/Cube.flax
(Stored with Git LFS)
BIN
Content/Editor/Primitives/Cube.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Primitives/Cylinder.flax
(Stored with Git LFS)
BIN
Content/Editor/Primitives/Cylinder.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Primitives/Sphere.flax
(Stored with Git LFS)
BIN
Content/Editor/Primitives/Sphere.flax
(Stored with Git LFS)
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();
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(%class%);
|
||||
public:
|
||||
// Custom float value.
|
||||
// Custom float value.
|
||||
API_FIELD(Attributes = "Range(0, 20), EditorOrder(0), EditorDisplay(\"Data\")")
|
||||
float FloatValue = 20.0f;
|
||||
// Custom vector data.
|
||||
// Custom vector data.
|
||||
API_FIELD(Attributes = "EditorOrder(1), EditorDisplay(\"Data\")")
|
||||
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)
|
||||
float4 PS_Fullscreen(Quad_VS2PS input) : SV_Target
|
||||
{
|
||||
// Solid color fill from the constant buffer passed from code
|
||||
return Color;
|
||||
// Solid color fill from the constant buffer passed from code
|
||||
return Color;
|
||||
}
|
||||
|
||||
BIN
Content/Editor/SpriteMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/SpriteMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Terrain/Circle Brush Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Terrain/Circle Brush Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Terrain/Highlight Terrain Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Terrain/Highlight Terrain Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/TexturePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/TexturePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Wires Debug Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Wires Debug Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultDeformableMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultDeformableMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultRadialMenu.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultRadialMenu.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultTerrainMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultTerrainMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/SingleColorMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/SingleColorMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/SkyboxMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/SkyboxMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/CAS.flax
(Stored with Git LFS)
BIN
Content/Shaders/CAS.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/ColorGrading.flax
(Stored with Git LFS)
BIN
Content/Shaders/ColorGrading.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Editor/Grid.flax
(Stored with Git LFS)
BIN
Content/Shaders/Editor/Grid.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Editor/LightmapUVsDensity.flax
(Stored with Git LFS)
BIN
Content/Shaders/Editor/LightmapUVsDensity.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/GI/DDGI.flax
(Stored with Git LFS)
BIN
Content/Shaders/GI/DDGI.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/GI/GlobalSurfaceAtlas.flax
(Stored with Git LFS)
BIN
Content/Shaders/GI/GlobalSurfaceAtlas.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/GlobalSignDistanceField.flax
(Stored with Git LFS)
BIN
Content/Shaders/GlobalSignDistanceField.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Quad.flax
(Stored with Git LFS)
BIN
Content/Shaders/Quad.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/SDF.flax
(Stored with Git LFS)
BIN
Content/Shaders/SDF.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/SSAO.flax
(Stored with Git LFS)
BIN
Content/Shaders/SSAO.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/SSR.flax
(Stored with Git LFS)
BIN
Content/Shaders/SSR.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/VolumetricFog.flax
(Stored with Git LFS)
BIN
Content/Shaders/VolumetricFog.flax
(Stored with Git LFS)
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
"Major": 1,
|
||||
"Minor": 9,
|
||||
"Revision": 0,
|
||||
"Build": 6606
|
||||
"Build": 6601
|
||||
},
|
||||
"Company": "Flax",
|
||||
"Copyright": "Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.",
|
||||
@@ -13,7 +13,6 @@
|
||||
"Configuration": {
|
||||
"UseCSharp": true,
|
||||
"UseLargeWorlds": false,
|
||||
"UseDotNet": true,
|
||||
"UseSDL": true
|
||||
"UseDotNet": true
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,6 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/UserRules/=UNION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/UserRules/=UNION_005FMEMBER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AI/@EntryIndexedValue">AI</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ARGB/@EntryIndexedValue">ARGB</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LO/@EntryIndexedValue">LO</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SDK/@EntryIndexedValue">SDK</s:String>
|
||||
|
||||
@@ -15,7 +15,7 @@ if errorlevel 1 goto BuildToolFailed
|
||||
|
||||
:: Build bindings for all editor configurations
|
||||
echo Building C# bindings...
|
||||
Binaries\Tools\Flax.Build.exe -build -BuildBindingsOnly -arch=x64 -platform=Windows --buildTargets=FlaxEditor,FlaxGame
|
||||
Binaries\Tools\Flax.Build.exe -build -BuildBindingsOnly -arch=x64 -platform=Windows --buildTargets=FlaxEditor
|
||||
|
||||
popd
|
||||
echo Done!
|
||||
|
||||
@@ -14,4 +14,4 @@ bash ./Development/Scripts/Mac/CallBuildTool.sh --genproject "$@"
|
||||
# Build bindings for all editor configurations
|
||||
echo Building C# bindings...
|
||||
# TODO: Detect the correct architecture here
|
||||
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=ARM64 -platform=Mac --buildTargets=FlaxEditor,FlaxGame
|
||||
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=ARM64 -platform=Mac --buildTargets=FlaxEditor
|
||||
|
||||
@@ -14,4 +14,4 @@ bash ./Development/Scripts/Linux/CallBuildTool.sh --genproject "$@"
|
||||
# Build bindings for all editor configurations
|
||||
echo Building C# bindings...
|
||||
# TODO: Detect the correct architecture here
|
||||
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=x64 -platform=Linux --buildTargets=FlaxEditor,FlaxGame
|
||||
Binaries/Tools/Flax.Build -build -BuildBindingsOnly -arch=x64 -platform=Linux --buildTargets=FlaxEditor
|
||||
|
||||
13
README.md
13
README.md
@@ -31,7 +31,7 @@ Follow the instructions below to compile and run the engine from source.
|
||||
* Install Visual Studio 2022 or newer
|
||||
* Install Windows 8.1 SDK or newer (via Visual Studio Installer)
|
||||
* Install Microsoft Visual C++ 2015 v140 toolset or newer (via Visual Studio Installer)
|
||||
* Install .NET 8 or 9 SDK for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install .NET 8 SDK for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install Git with LFS
|
||||
* Clone repo (with LFS)
|
||||
* Run **GenerateProjectFiles.bat**
|
||||
@@ -44,9 +44,8 @@ Follow the instructions below to compile and run the engine from source.
|
||||
## Linux
|
||||
|
||||
* Install Visual Studio Code
|
||||
* Install .NET 8 or 9 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install .NET 8 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Ubuntu: `sudo apt install dotnet-sdk-8.0`
|
||||
* Arch: `sudo pacman -S dotnet-sdk-8.0 dotnet-runtime-8.0 dotnet-targeting-pack-8.0 dotnet-host`
|
||||
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
|
||||
* Ubuntu: `sudo apt install vulkan-sdk`
|
||||
* Arch: `sudo pacman -S spirv-tools vulkan-headers vulkan-tools vulkan-validation-layers`
|
||||
@@ -68,12 +67,12 @@ Follow the instructions below to compile and run the engine from source.
|
||||
## Mac
|
||||
|
||||
* Install XCode
|
||||
* Install .NET 8 or 9 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install .NET 8 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
|
||||
* Clone repo (with LFS)
|
||||
* Run `GenerateProjectFiles.command`
|
||||
* Open workspace with XCode or Visual Studio Code
|
||||
* Build and run (configuration `Editor.Mac.Development`)
|
||||
* Build and run (configuration `Editor.Mac.Development`)
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
@@ -125,7 +124,3 @@ Install `.NET SDK`, `NuGet package manager` and `NuGet targets and build tasks`
|
||||
Using Flax source code is strictly governed by the Flax Engine End User License Agreement. If you don't agree to those terms, as amended from time to time, you are not permitted to access or use Flax Engine.
|
||||
|
||||
We welcome any contributions to Flax Engine development through pull requests on GitHub. Most of our active development is in the master branch, so we prefer to take pull requests there (particularly for new features). We try to make sure that all new code adheres to the Flax coding standards. All contributions are governed by the terms of the [EULA](https://flaxengine.com/licensing/).
|
||||
|
||||
## SAST Tools
|
||||
|
||||
[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.Utilities;
|
||||
@@ -95,8 +94,30 @@ public class AssetPickerValidator : IContentItemOwner
|
||||
/// </summary>
|
||||
public string SelectedPath
|
||||
{
|
||||
get => Utilities.Utils.ToPathProject(_selectedItem?.Path ?? _selected?.Path);
|
||||
set => SelectedItem = string.IsNullOrEmpty(value) ? null : Editor.Instance.ContentDatabase.Find(Utilities.Utils.ToPathAbsolute(value));
|
||||
get
|
||||
{
|
||||
string path = _selectedItem?.Path ?? _selected?.Path;
|
||||
if (path != null)
|
||||
{
|
||||
// Convert into path relative to the project (cross-platform)
|
||||
var projectFolder = Globals.ProjectFolder;
|
||||
if (path.StartsWith(projectFolder))
|
||||
path = path.Substring(projectFolder.Length + 1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
SelectedItem = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var path = StringUtils.IsRelative(value) ? Path.Combine(Globals.ProjectFolder, value) : value;
|
||||
SelectedItem = Editor.Instance.ContentDatabase.Find(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -221,7 +242,7 @@ public class AssetPickerValidator : IContentItemOwner
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AssetPickerValidator"/> class.
|
||||
/// </summary>
|
||||
/// <param name="assetType">The asset types that this picker accepts.</param>
|
||||
/// <param name="assetType">The assets types that this picker accepts.</param>
|
||||
public AssetPickerValidator(ScriptType assetType)
|
||||
{
|
||||
_type = assetType;
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace FlaxEditor.Content.Create
|
||||
{
|
||||
/// <summary>
|
||||
/// Prefab asset creating handler. Allows to specify base actor to use as the root.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class PrefabCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
public class Options
|
||||
{
|
||||
/// <summary>
|
||||
/// The root actor.
|
||||
/// </summary>
|
||||
[TypeReference(typeof(FlaxEngine.Actor), nameof(IsValid))]
|
||||
[Tooltip("The actor type of the root of the new Prefab.")]
|
||||
public Type RootActorType = typeof(EmptyActor);
|
||||
|
||||
private static bool IsValid(Type type)
|
||||
{
|
||||
return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Options _options = new Options();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override object Settings => _options;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PrefabCreateEntry"/> class.
|
||||
/// </summary>
|
||||
/// <param name="resultUrl">The result file url.</param>
|
||||
public PrefabCreateEntry(string resultUrl)
|
||||
: base("Settings", resultUrl)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Create()
|
||||
{
|
||||
var actorType = new ScriptType(_options.RootActorType ?? typeof(EmptyActor));
|
||||
Actor actor;
|
||||
try
|
||||
{
|
||||
actor = actorType.CreateInstance() as Actor;
|
||||
Object.Destroy(actor, 20.0f);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Editor.LogError("Failed to create prefab with root actor type: " + actorType.Name);
|
||||
Editor.LogWarning(ex);
|
||||
return true;
|
||||
}
|
||||
|
||||
return PrefabManager.CreatePrefab(actor, ResultUrl, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Widget asset creating handler. Allows to specify base UIControl to use as the root.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class WidgetCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
public class Options
|
||||
{
|
||||
/// <summary>
|
||||
/// Which mode is used to initialize this widget.
|
||||
/// </summary>
|
||||
public enum WidgetMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize the widget with a UICanvas.
|
||||
/// </summary>
|
||||
Canvas,
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the widget with a UIControl.
|
||||
/// </summary>
|
||||
Control
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The mode used to initialize the widget.
|
||||
/// </summary>
|
||||
[Tooltip("Whether to initialize the widget with a canvas or a control.")]
|
||||
public WidgetMode WidgetInitializationMode = WidgetMode.Control;
|
||||
|
||||
bool ShowRoot => WidgetInitializationMode == WidgetMode.Control;
|
||||
|
||||
/// <summary>
|
||||
/// The root control.
|
||||
/// </summary>
|
||||
[TypeReference(typeof(Control), nameof(IsValid))]
|
||||
[Tooltip("The control type of the root of the new Widget's root control."), VisibleIf(nameof(ShowRoot))]
|
||||
public Type RootControlType = typeof(Button);
|
||||
|
||||
private static bool IsValid(Type type)
|
||||
{
|
||||
return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Options _options = new Options();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override object Settings => _options;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WidgetCreateEntry"/> class.
|
||||
/// </summary>
|
||||
/// <param name="resultUrl">The result file url.</param>
|
||||
public WidgetCreateEntry(string resultUrl)
|
||||
: base("Settings", resultUrl)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Create()
|
||||
{
|
||||
Actor actor = null;
|
||||
|
||||
if (_options.WidgetInitializationMode == Options.WidgetMode.Control)
|
||||
{
|
||||
var controlType = new ScriptType(_options.RootControlType ?? typeof(Control));
|
||||
Control control;
|
||||
try
|
||||
{
|
||||
control = controlType.CreateInstance() as Control;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Editor.LogError("Failed to create widget with root control type: " + controlType.Name);
|
||||
Editor.LogWarning(ex);
|
||||
return true;
|
||||
}
|
||||
|
||||
actor = new UIControl
|
||||
{
|
||||
Control = control,
|
||||
Name = controlType.Name
|
||||
};
|
||||
}
|
||||
else if (_options.WidgetInitializationMode == Options.WidgetMode.Canvas)
|
||||
{
|
||||
actor = new UICanvas();
|
||||
}
|
||||
|
||||
if (actor == null)
|
||||
{
|
||||
Editor.LogError("Failed to create widget. Final actor was null.");
|
||||
return true;
|
||||
}
|
||||
Object.Destroy(actor, 20.0f);
|
||||
|
||||
return PrefabManager.CreatePrefab(actor, ResultUrl, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,8 +61,6 @@ namespace FlaxEditor.Content.GUI
|
||||
private bool _isRubberBandSpanning;
|
||||
private Float2 _mousePressLocation;
|
||||
private Rectangle _rubberBandRectangle;
|
||||
private bool _isCutting;
|
||||
private List<ContentItem> _cutItems = new List<ContentItem>();
|
||||
|
||||
private bool _validDragOver;
|
||||
private DragActors _dragActors;
|
||||
@@ -85,9 +83,9 @@ namespace FlaxEditor.Content.GUI
|
||||
public event Action<List<ContentItem>> OnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// Called when user wants to paste the files/folders. Bool is for cutting.
|
||||
/// Called when user wants to paste the files/folders.
|
||||
/// </summary>
|
||||
public event Action<string[], bool> OnPaste;
|
||||
public event Action<string[]> OnPaste;
|
||||
|
||||
/// <summary>
|
||||
/// Called when user wants to duplicate the item(s).
|
||||
@@ -212,12 +210,6 @@ namespace FlaxEditor.Content.GUI
|
||||
}),
|
||||
new InputActionsContainer.Binding(options => options.Copy, Copy),
|
||||
new InputActionsContainer.Binding(options => options.Paste, Paste),
|
||||
new InputActionsContainer.Binding(options => options.Cut, Cut),
|
||||
new InputActionsContainer.Binding(options => options.Undo, () =>
|
||||
{
|
||||
if (_isCutting)
|
||||
UpdateContentItemCut(false);
|
||||
}),
|
||||
new InputActionsContainer.Binding(options => options.Duplicate, Duplicate),
|
||||
});
|
||||
}
|
||||
@@ -470,7 +462,6 @@ namespace FlaxEditor.Content.GUI
|
||||
/// </summary>
|
||||
public void Duplicate()
|
||||
{
|
||||
UpdateContentItemCut(false);
|
||||
OnDuplicate?.Invoke(_selection);
|
||||
}
|
||||
|
||||
@@ -484,7 +475,6 @@ namespace FlaxEditor.Content.GUI
|
||||
|
||||
var files = _selection.ConvertAll(x => x.Path).ToArray();
|
||||
Clipboard.Files = files;
|
||||
UpdateContentItemCut(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -506,36 +496,7 @@ namespace FlaxEditor.Content.GUI
|
||||
if (files == null || files.Length == 0)
|
||||
return;
|
||||
|
||||
OnPaste?.Invoke(files, _isCutting);
|
||||
UpdateContentItemCut(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cuts the items.
|
||||
/// </summary>
|
||||
public void Cut()
|
||||
{
|
||||
Copy();
|
||||
UpdateContentItemCut(true);
|
||||
}
|
||||
|
||||
private void UpdateContentItemCut(bool cut)
|
||||
{
|
||||
_isCutting = cut;
|
||||
|
||||
// Add selection to cut list
|
||||
if (cut)
|
||||
_cutItems.AddRange(_selection);
|
||||
|
||||
// Update item with if it is being cut.
|
||||
foreach (var item in _cutItems)
|
||||
{
|
||||
item.IsBeingCut = cut;
|
||||
}
|
||||
|
||||
// Clean up cut items
|
||||
if (!cut)
|
||||
_cutItems.Clear();
|
||||
OnPaste?.Invoke(files);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -58,10 +58,10 @@ namespace FlaxEngine.Tools
|
||||
FieldInfo[] fields = typeof(CustomMaxSizes).GetFields();
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
var @field = fields[i];
|
||||
if (@field.Name.Equals("value__"))
|
||||
var field = fields[i];
|
||||
if (field.Name.Equals("value__"))
|
||||
continue;
|
||||
if (value == (int)@field.GetRawConstantValue())
|
||||
if (value == (int)field.GetRawConstantValue())
|
||||
return (CustomMaxSizes)value;
|
||||
}
|
||||
return CustomMaxSizes._8192;
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace FlaxEditor.Content
|
||||
// Translate asset type name
|
||||
var typeName = TypeName;
|
||||
string[] typeNamespaces = typeName.Split('.');
|
||||
if (typeNamespaces.Length != 0 && typeNamespaces[typeNamespaces.Length - 1].Length != 0)
|
||||
if (typeNamespaces.Length != 0 && typeNamespaces.Length != 0)
|
||||
{
|
||||
typeName = Utilities.Utils.GetPropertyNameUI(typeNamespaces[typeNamespaces.Length - 1]);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using FlaxEngine;
|
||||
namespace FlaxEditor.Content
|
||||
{
|
||||
/// <summary>
|
||||
/// Content item that contains C# file with source code.
|
||||
/// Content item that contains C# script file with source code.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.ScriptItem" />
|
||||
public class CSharpScriptItem : ScriptItem
|
||||
|
||||
@@ -182,11 +182,6 @@ namespace FlaxEditor.Content
|
||||
/// </summary>
|
||||
public const int DefaultHeight = (DefaultThumbnailSize + 2 * DefaultMarginSize + DefaultTextHeight);
|
||||
|
||||
/// <summary>
|
||||
/// Whether the item is being but.
|
||||
/// </summary>
|
||||
public bool IsBeingCut;
|
||||
|
||||
private ContentFolder _parentFolder;
|
||||
|
||||
private bool _isMouseDown;
|
||||
@@ -388,7 +383,7 @@ namespace FlaxEditor.Content
|
||||
{
|
||||
sb.Append("Type: ").Append(TypeDescription).AppendLine();
|
||||
if (File.Exists(Path))
|
||||
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((ulong)new FileInfo(Path).Length)).AppendLine();
|
||||
sb.Append("Size: ").Append(Utilities.Utils.FormatBytesCount((int)new FileInfo(Path).Length)).AppendLine();
|
||||
sb.Append("Path: ").Append(Utilities.Utils.GetAssetNamePathWithExt(Path)).AppendLine();
|
||||
}
|
||||
|
||||
@@ -750,15 +745,8 @@ namespace FlaxEditor.Content
|
||||
|
||||
// Draw short name
|
||||
Render2D.PushClip(ref textRect);
|
||||
var scale = 0.95f * view.ViewScale;
|
||||
Render2D.DrawText(style.FontMedium, ShowFileExtension || view.ShowFileExtensions ? FileName : ShortName, textRect, style.Foreground, nameAlignment, TextAlignment.Center, TextWrapping.WrapWords, 1f, scale);
|
||||
Render2D.DrawText(style.FontMedium, ShowFileExtension || view.ShowFileExtensions ? FileName : ShortName, textRect, style.Foreground, nameAlignment, TextAlignment.Center, TextWrapping.WrapWords, 1f, 0.95f);
|
||||
Render2D.PopClip();
|
||||
|
||||
if (IsBeingCut)
|
||||
{
|
||||
var color = style.LightBackground.AlphaMultiplied(0.5f);
|
||||
Render2D.FillRectangle(clientRect, color);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string TypeDescription => Path.EndsWith(".h") || Path.EndsWith(".hpp") ? "C++ Header File" : "C++ Source Code";
|
||||
public override string TypeDescription => Path.EndsWith(".h") ? "C++ Header File" : "C++ Source Code";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.CPPScript128;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace FlaxEditor.Content
|
||||
/// <seealso cref="FlaxEditor.Content.JsonAssetItem" />
|
||||
public sealed class PrefabItem : JsonAssetItem
|
||||
{
|
||||
private string _cachedTypeDescription = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PrefabItem"/> class.
|
||||
/// </summary>
|
||||
@@ -44,26 +42,6 @@ namespace FlaxEditor.Content
|
||||
/// <inheritdoc />
|
||||
public override SpriteHandle DefaultThumbnail => SpriteHandle.Invalid;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string TypeDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedTypeDescription == null)
|
||||
{
|
||||
_cachedTypeDescription = "Prefab";
|
||||
var prefab = FlaxEngine.Content.Load<Prefab>(ID);
|
||||
if (prefab)
|
||||
{
|
||||
Actor root = prefab.GetDefaultInstance();
|
||||
if (root is UIControl or UICanvas)
|
||||
_cachedTypeDescription = "Widget";
|
||||
}
|
||||
}
|
||||
return _cachedTypeDescription;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsOfType(Type type)
|
||||
{
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEditor.Content
|
||||
{
|
||||
/// <summary>
|
||||
/// Content item that contains video media file.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.JsonAssetItem" />
|
||||
public sealed class VideoItem : FileItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VideoItem"/> class.
|
||||
/// </summary>
|
||||
/// <param name="path">The file path.</param>
|
||||
public VideoItem(string path)
|
||||
: base(path)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string TypeDescription => "Video";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Document128;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user