From b026b603b1e425e7e3b89f51587537f41673730c Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 27 Mar 2024 23:21:38 +0100 Subject: [PATCH 01/10] Post Release 6.3.0 (#119) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 333ad5fd..0d8dfb5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + ## [6.3.0] - 2024-03-27 ## Added From 7cd2d1b42e54dd098ef019b9c220392de9872fea Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Thu, 28 Mar 2024 22:40:03 +0100 Subject: [PATCH 02/10] Feature/test project player (#114) * feat: Project based player tests * feat: Virtual job that runs all build&run jobs. * feat: Project based player tests with split build and run actions. * fix: Install fitting component and use IL2CPP on all player tests. * fix: For split build/run jobs, the build job saves the entire project as artifact and the run job re-uses it and does not create it from scratch. * fix: Preserve project logs * feat: Setting up Universal Render Pipeline Asset prior to running URP project tests. * fix: Remove warning about unknown UTR parameter `--stdout-filter=minimal` * fix: Export tests on URP fallback to BuiltIn glTF JSON reference values in player builds as well. * fix(tests): Render pipeline specific shader variant collections. * fix(ci): Establish Android ADB connection (like upm-ci) * fix(ci): Trying Android run on Samsung mobile via USB * chore: fixed comment * fix: Don't provide player connection IP in non Android/Shield tests. * fix: Re-create full project in run job (instead of transferring giant artifact). * feat: Use project based player tests instead of upm-ci based ones in tiggers. * fix: Timeout on 2020 LTS and Windows due to Draco for Unity/KTX for Unity WebGL sub-packages. * chore: Removed obsolete host URL parameter. * feat(ci): Dedicated coverage platform/editor sets per test setup give more nuanced control over coverage. fix: Don't run coverage on 2020 anymore as it's unstable. --- .yamato/package.metafile | 57 +- .yamato/project-test.yml | 547 +++++++++++++++++- .yamato/triggers.yml | 6 +- Tests/Editor/PreprocessBuild.cs | 28 +- Tests/Editor/SetupProject.cs | 39 ++ Tests/Editor/glTFast.Editor.Tests.asmdef | 11 +- Tests/Runtime/RenderPipelineAssets.meta | 8 + .../RenderPipelineAssets/URP-Forward.asset | 134 +++++ .../URP-Forward.asset.meta | 8 + .../URP-Forward_Renderer.asset | 43 ++ .../URP-Forward_Renderer.asset.meta | 8 + Tests/Runtime/Scripts/Export/ExportTests.cs | 68 ++- .../glTF-test-models-hdrp.shadervariants | 55 ++ .../glTF-test-models-hdrp.shadervariants.meta | 8 + .../glTF-test-models-urp.10.shadervariants | 77 +++ ...lTF-test-models-urp.10.shadervariants.meta | 8 + .../glTF-test-models-urp.12.shadervariants | 39 ++ ...lTF-test-models-urp.12.shadervariants.meta | 8 + 18 files changed, 1085 insertions(+), 67 deletions(-) create mode 100644 Tests/Runtime/RenderPipelineAssets.meta create mode 100644 Tests/Runtime/RenderPipelineAssets/URP-Forward.asset create mode 100644 Tests/Runtime/RenderPipelineAssets/URP-Forward.asset.meta create mode 100644 Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset create mode 100644 Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants.meta diff --git a/.yamato/package.metafile b/.yamato/package.metafile index 2dcc8df9..1909a514 100644 --- a/.yamato/package.metafile +++ b/.yamato/package.metafile @@ -1,4 +1,6 @@ test_setups: + # Project profile name + # see GLTFast.Editor.Tests.SetupProject.ApplySetup (Tests/Editor/SetupProject.cs) for details - project_setup: default # # Use to limit versions # editor_versions: [2020,2021,2022,2023.2,trunk] @@ -11,20 +13,39 @@ test_setups: editor: trunk - platform: ubuntu editor: 2022 - coverage: !!bool true + coverage_sets: + # default for coverage: windows + current LTS + - platform: win + editor: 2022 - project_setup: minimalistic editor_versions: [2020,trunk] platforms: [win] pr_sets: - platform: win editor: trunk + coverage_sets: + # default for coverage: windows + current LTS + - platform: win + editor: 2022 - project_setup: all_defines + render_pipeline: URP-Forward editor_versions: [2020,trunk] platforms: [win] pr_sets: - platform: win editor: trunk - coverage: !!bool true + coverage_sets: + # default for coverage: windows + current LTS + - platform: win + editor: 2022 + # TODO: Move those to `urp` and `hdrp` test setup at some point + # For URP/shader graph test all versions + - platform: win + editor: 2021 + - platform: win + editor: 2023 + - platform: win + editor: trunk editor_versions: - 2020 @@ -35,16 +56,27 @@ editor_versions: platforms: win: - agent: win + test: win + build_and_run: win + platform: StandaloneWindows64 + component: il2cpp mac: - agent: mac + test: mac + build_and_run: mac + platform: StandaloneOSX + component: il2cpp ubuntu: - agent: ubuntu + test: ubuntu + platform: StandaloneLinux64 + component: il2cpp + android: + build: win + run: samsung + component: Android test_platforms: - name: win agent: win - coverage: !!bool true - name: mac agent: mac - name: ubuntu @@ -94,6 +126,11 @@ agents: type: Unity::VM image: package-ci/ubuntu-22.04:v4 flavor: b1.large + samsung: + os: win + type: Unity::mobile::samsung + image: package-ci/win10:v4 + flavor: b1.large shield: os: win type: Unity::mobile::shield @@ -140,14 +177,16 @@ os_variables: git_url: ${GIT_REPOSITORY_URL} git_revision: ${GIT_REVISION} tool_utr: "./utr" + bokken_host_ip: ${BOKKEN_HOST_IP} # Windows specific win: yamato_source_dir: "%YAMATO_SOURCE_DIR%" git_url: "%GIT_REPOSITORY_URL%" git_revision: "%GIT_REVISION%" tool_utr: "utr.bat" + bokken_host_ip: "%BOKKEN_HOST_IP%" editor_location: - win: "Unity.exe" - mac: "Unity.app/Contents/MacOS/Unity" - ubuntu: "Unity" + win: "\\.Editor\\Unity.exe" + mac: "/.Editor/Unity.app/Contents/MacOS/Unity" + ubuntu: "/.Editor/Unity" diff --git a/.yamato/project-test.yml b/.yamato/project-test.yml index 258e6e8f..7356edfa 100644 --- a/.yamato/project-test.yml +++ b/.yamato/project-test.yml @@ -20,19 +20,6 @@ {% for editor in editor_versions -%} {% for platform_id in platform_ids -%} {% assign platform = platforms[platform_id] -%} -{% if platform_id == "win" -%} - {% assign os = os_variables.win -%} - {% assign is_windows = true -%} - {% assign editor_exe = os.yamato_source_dir | append: "\.Editor\" | append: editor_location.win -%} -{% else -%} - {% assign os = os_variables.unix -%} - {% assign is_windows = false -%} - {% if platform_id == "mac" -%} - {% assign editor_exe = os.yamato_source_dir | append: "/.Editor/" | append: editor_location.mac -%} - {% else -%} - {% assign editor_exe = os.yamato_source_dir | append: "/.Editor/" | append: editor_location.ubuntu -%} - {% endif -%} -{% endif -%} {% assign is_pr_set = false -%} {% for pr_set in test_setup.pr_sets -%} @@ -41,11 +28,44 @@ {% break -%} {% endif -%} {% endfor -%} +{% assign is_coverage_set = false -%} +{% for coverage_set in test_setup.coverage_sets -%} + {% if coverage_set.platform == platform_id and coverage_set.editor == editor -%} + {% assign is_coverage_set = true -%} + {% break -%} + {% endif -%} +{% endfor -%} + +{% capture job_artifacts -%} + artifacts: + logs: + paths: + - "test-results~/**/*" + Project: + paths: + - "{{ job_project_path }}/Packages/*.json" + - "{{ job_project_path }}/ProjectSettings/*.asset" + - "{{ job_project_path }}/Logs/*"{% endcapture -%} + +{% if platform.test -%} +{% assign agent = agents[platform.test] -%} +{% case agent.os -%} + {% when "win" -%} + {% assign os = os_variables.win -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.win -%} + {% when "mac" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.mac -%} + {% when "linux" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.ubuntu -%} + {% else -%} + Platform {{ platform.test }} has unknown OS! +{% endcase -%} test_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: name : Test {{ test_setup.project_setup }} with {{ editor }} on {{ platform_id }} agent: -{% assign agent = agents[platform.agent] -%} type: {{ agent.type }} image: {{ agent.image }} flavor: {{ agent.flavor}} @@ -75,27 +95,27 @@ test_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: {% endfor -%} # Install unity-downloader-cli and unity-config -{% if is_windows -%} +{% if agent.os == "win" -%} - | where /q gsudo.exe && set CMD_ADMIN=gsudo.exe %CMD_ADMIN% choco source add --priority 1 -n Unity -s {{ registry.artifactory }}/api/nuget/unity-choco-local %CMD_ADMIN% choco install unity-config -y %CMD_ADMIN% choco install unity-downloader-cli -y -{% elsif platform.name == "mac" -%} +{% elsif agent.os == "mac" -%} - brew tap --force-auto-update unity/unity git@github.cds.internal.unity3d.com:unity/homebrew-unity.git - brew install unity-config {% endif -%} # Install UnifiedTestRunner -{% if is_windows -%} +{% if agent.os == "win" -%} - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr.bat --output {{ os.tool_utr }} {% else -%} - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr --output {{ os.tool_utr }} - chmod +x {{ os.tool_utr }} {% endif -%} - # Install Unity Editor with IL2CPP - - unity-downloader-cli -u {{ editor }} -c Editor -c il2cpp -w --fast + # Install Unity Editor and required components + - unity-downloader-cli -u {{ editor }} -c Editor -c {{ platform.component }} -w --fast # Create test project - | @@ -120,40 +140,465 @@ test_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: -quit -logFile {{ results_path }}/UnityProjectSetup.log +{% if test_setup.render_pipeline -%} + # Apply render pipeline asset + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.SetRenderPipeline SRP:{{ test_setup.render_pipeline }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log +{% endif -%} + # Run Tests # TODO: upm-ci rocks UPM and other cache directories. Maybe we can speed things up this way as well. + # TODO: DISABLE_SUB_PACKAGE_LOAD is required for 2020 only. Eventually remove all occurrences. - > -{% if is_windows -%} +{% if agent.os == "win" -%} set GLTF_TEST_ASSET_DIR={{ os.yamato_source_dir }}\Assets + + set DISABLE_SUB_PACKAGE_LOAD=TRUE {% else -%} export GLTF_TEST_ASSET_DIR="{{ os.yamato_source_dir }}/Assets" + + export DISABLE_SUB_PACKAGE_LOAD=TRUE {% endif -%} {{ os.tool_utr }} --testproject={{ job_project_path }} --editor-location=.Editor --artifacts_path={{ results_path }} - --stdout-filter=minimal --reruncount=2 --verbose --extra-editor-arg="-enablePackageManagerTraces -upmNoDefaultPackages" --suite=editor --suite=playmode -{% if test_setup.coverage and is_pr_set -%} +{% if is_coverage_set -%} --enable-code-coverage --coverage-results-path={{ results_path }} --coverage-options='generateAdditionalMetrics;generateHtmlReport;assemblyFilters:+glTFast*,+Unity.Cloud.Gltfast*,-glTFast*Tests*;pathReplacePatterns:**/PackageCache/com.unity.cloud.gltfast@*/,;sourcePaths:{{ os.yamato_source_dir }}/Packages/gltfast' --coverage-results-path={{ os.yamato_source_dir }}/test-results~/CoverageResults - --coverage-upload-options="hostUrl:https://codecov.unity3d.com;reportsDir:{{ os.yamato_source_dir }}/test-results~/CoverageResults;reports:*.xml;sourceDir:Packages/gltfast;repo:unity/com.unity.cloud.gltfast.src;changeset:{{ os.git_revision }};name:{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }};flags:{{ test_setup.project_setup }};verbose" + --coverage-upload-options="reportsDir:{{ os.yamato_source_dir }}/test-results~/CoverageResults;reports:*.xml;sourceDir:Packages/gltfast;repo:unity/com.unity.cloud.gltfast.src;changeset:{{ os.git_revision }};name:{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }};flags:{{ test_setup.project_setup }};verbose" +{% endif -%} +{{ job_artifacts }} +{% endif -%} + +{% if platform.build_and_run -%} +{% assign agent = agents[platform.build_and_run] -%} +{% case agent.os -%} + {% when "win" -%} + {% assign os = os_variables.win -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.win -%} + {% when "mac" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.mac -%} + {% when "linux" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.ubuntu -%} + {% else -%} + Platform {{ platform.build_and_run }} has unknown OS! +{% endcase -%} + +build_and_run_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: + name : Build and run {{ test_setup.project_setup }} with {{ editor }} on {{ platform_id }} + agent: +{% assign agent = agents[platform.build_and_run] -%} + type: {{ agent.type }} + image: {{ agent.image }} + flavor: {{ agent.flavor}} + source: + skip_checkout: true + commands: + # Clone package into sub-folder `Packages/gltf` + - | + mkdir Packages + pushd Packages + git clone {{ os.git_url }} --no-checkout gltfast + cd gltfast + git fetch origin {{ os.git_revision }} + git checkout -f --detach {{ os.git_revision }} + popd + + # Clone all test asset repositories into `Assets` + - mkdir Assets +{% for asset_set in asset_sets -%} + - | + pushd Assets + git clone {{ asset_set.git_uri }} --no-checkout {{ asset_set.name }} + cd {{ asset_set.name }} + git fetch origin {{ asset_set.git_revision }} + git checkout -f --detach {{ asset_set.git_revision }} + popd +{% endfor -%} + + # Install unity-downloader-cli and unity-config +{% if agent.os == "win" -%} + - | + where /q gsudo.exe && set CMD_ADMIN=gsudo.exe + %CMD_ADMIN% choco source add --priority 1 -n Unity -s {{ registry.artifactory }}/api/nuget/unity-choco-local + %CMD_ADMIN% choco install unity-config -y + %CMD_ADMIN% choco install unity-downloader-cli -y +{% elsif agent.os == "mac" -%} + - brew tap --force-auto-update unity/unity git@github.cds.internal.unity3d.com:unity/homebrew-unity.git + - brew install unity-config +{% endif -%} + + # Install UnifiedTestRunner +{% if agent.os == "win" -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr.bat --output {{ os.tool_utr }} +{% else -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr --output {{ os.tool_utr }} + - chmod +x {{ os.tool_utr }} +{% endif -%} + + # Install Unity Editor and required components + - unity-downloader-cli -u {{ editor }} -c Editor -c {{ platform.component }} -w --fast + + # Create test project + - | + unity-config project create {{ job_project_path }} + unity-config project add testable com.unity.cloud.gltfast + unity-config project add dependency com.unity.cloud.gltfast@file:./../../../Packages/gltfast + unity-config project add dependency {{ test_framework }} -p {{ job_project_path }} +{% for dep in test_dependencies -%} + unity-config project add dependency {{ dep.id }}@{{ dep.version }} -p {{ job_project_path }} +{% endfor -%} + +{% capture results_path -%}{{ os.yamato_source_dir }}/test-results~/com.unity.cloud.gltfast/{{ platform_id }}/{{ editor }}/{{ test_setup.project_setup }}{% endcapture -%} + + # Apply project setup + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.ApplySetup glTFastSetup:{{ test_setup.project_setup }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log + +{% if test_setup.render_pipeline -%} + # Apply render pipeline asset + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.SetRenderPipeline SRP:{{ test_setup.render_pipeline }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log +{% endif -%} + + # Run Tests + # TODO: upm-ci rocks UPM and other cache directories. Maybe we can speed things up this way as well. + # TODO: DISABLE_SUB_PACKAGE_LOAD is required for 2020 only. Eventually remove all occurrences. + - > +{% if agent.os == "win" -%} + set GLTF_TEST_ASSET_DIR={{ os.yamato_source_dir }}\Assets + + set DISABLE_SUB_PACKAGE_LOAD=TRUE +{% else -%} + export GLTF_TEST_ASSET_DIR="{{ os.yamato_source_dir }}/Assets" + + export DISABLE_SUB_PACKAGE_LOAD=TRUE +{% endif -%} + + {{ os.tool_utr }} + --testproject={{ job_project_path }} + --editor-location=.Editor + --artifacts_path={{ results_path }} + --reruncount=2 + --verbose + --extra-editor-arg="-enablePackageManagerTraces -upmNoDefaultPackages" + --suite=playmode + --scripting-backend=Il2Cpp + --platform={% if platform.platform -%}{{ platform.platform }}{% else -%}{{ platform_id }}{% endif %} +{{ job_artifacts }} +{% endif -%} + +{% if platform.build -%} +{% assign agent = agents[platform.build] -%} +{% case agent.os -%} + {% when "win" -%} + {% assign os = os_variables.win -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.win -%} + {% when "mac" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.mac -%} + {% when "linux" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.ubuntu -%} + {% else -%} + Platform {{ platform.build }} has unknown OS! +{% endcase -%} + +build_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: + name : Build {{ test_setup.project_setup }} with {{ editor }} on {{ platform_id }} + agent: +{% assign agent = agents[platform.build] -%} + type: {{ agent.type }} + image: {{ agent.image }} + flavor: {{ agent.flavor}} + source: + skip_checkout: true + commands: + # Clone package into sub-folder `Packages/gltf` + - | + mkdir Packages + pushd Packages + git clone {{ os.git_url }} --no-checkout gltfast + cd gltfast + git fetch origin {{ os.git_revision }} + git checkout -f --detach {{ os.git_revision }} + popd + + # Clone all test asset repositories into `Assets` + - mkdir Assets +{% for asset_set in asset_sets -%} + - | + pushd Assets + git clone {{ asset_set.git_uri }} --no-checkout {{ asset_set.name }} + cd {{ asset_set.name }} + git fetch origin {{ asset_set.git_revision }} + git checkout -f --detach {{ asset_set.git_revision }} + popd +{% endfor -%} + + # Install unity-downloader-cli and unity-config +{% if agent.os == "win" -%} + - | + where /q gsudo.exe && set CMD_ADMIN=gsudo.exe + %CMD_ADMIN% choco source add --priority 1 -n Unity -s {{ registry.artifactory }}/api/nuget/unity-choco-local + %CMD_ADMIN% choco install unity-config -y + %CMD_ADMIN% choco install unity-downloader-cli -y +{% elsif agent.os == "mac" -%} + - brew tap --force-auto-update unity/unity git@github.cds.internal.unity3d.com:unity/homebrew-unity.git + - brew install unity-config +{% endif -%} + + # Install UnifiedTestRunner +{% if agent.os == "win" -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr.bat --output {{ os.tool_utr }} +{% else -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr --output {{ os.tool_utr }} + - chmod +x {{ os.tool_utr }} {% endif -%} + + # Install Unity Editor and required components + - unity-downloader-cli -u {{ editor }} -c Editor -c {{ platform.component }} -w --fast + + # Create test project + - | + unity-config project create {{ job_project_path }} + unity-config project add testable com.unity.cloud.gltfast + unity-config project add dependency com.unity.cloud.gltfast@file:./../../../Packages/gltfast + unity-config project add dependency {{ test_framework }} -p {{ job_project_path }} +{% for dep in test_dependencies -%} + unity-config project add dependency {{ dep.id }}@{{ dep.version }} -p {{ job_project_path }} +{% endfor -%} + +{% capture results_path -%}{{ os.yamato_source_dir }}/test-results~/com.unity.cloud.gltfast/{{ platform_id }}/{{ editor }}/{{ test_setup.project_setup }}{% endcapture -%} + + # Apply project setup + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.ApplySetup glTFastSetup:{{ test_setup.project_setup }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log + +{% if test_setup.render_pipeline -%} + # Apply render pipeline asset + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.SetRenderPipeline SRP:{{ test_setup.render_pipeline }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log +{% endif -%} + + # Run Tests + # TODO: upm-ci rocks UPM and other cache directories. Maybe we can speed things up this way as well. + # TODO: DISABLE_SUB_PACKAGE_LOAD is required for 2020 only. Eventually remove all occurrences. + - > +{% if agent.os == "win" -%} + set GLTF_TEST_ASSET_DIR={{ os.yamato_source_dir }}\Assets + + set DISABLE_SUB_PACKAGE_LOAD=TRUE +{% else -%} + export GLTF_TEST_ASSET_DIR="{{ os.yamato_source_dir }}/Assets" + + export DISABLE_SUB_PACKAGE_LOAD=TRUE +{% endif -%} + + {{ os.tool_utr }} + --testproject={{ job_project_path }} + --editor-location=.Editor + --artifacts_path={{ results_path }} + --reruncount=2 + --verbose + --extra-editor-arg="-enablePackageManagerTraces -upmNoDefaultPackages" + --suite=playmode + --scripting-backend=Il2Cpp + --platform={% if platform.platform -%}{{ platform.platform }}{% else -%}{{ platform_id }}{% endif %} + --build-only + --player-save-path={{ results_path }}/player artifacts: logs: paths: - "test-results~/**/*" - Project: - paths: - - "{{ job_project_path }}/Packages/*.json" - - "{{ job_project_path }}/ProjectSettings/*.asset" +{% endif -%} + +{% if platform.run -%} +{% assign agent = agents[platform.run] -%} +{% case agent.os -%} + {% when "win" -%} + {% assign os = os_variables.win -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.win -%} + {% when "mac" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.mac -%} + {% when "linux" -%} + {% assign os = os_variables.unix -%} + {% assign editor_exe = os.yamato_source_dir | append: editor_location.ubuntu -%} + {% else -%} + Platform {{ platform.run }} has unknown OS! +{% endcase -%} + +run_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }}: + name : Run {{ test_setup.project_setup }} with {{ editor }} on {{ platform_id }} + agent: +{% assign agent = agents[platform.run] -%} + type: {{ agent.type }} + image: {{ agent.image }} + flavor: {{ agent.flavor}} + source: + skip_checkout: true + commands: + # Clone package into sub-folder `Packages/gltf` + - | + mkdir Packages + pushd Packages + git clone {{ os.git_url }} --no-checkout gltfast + cd gltfast + git fetch origin {{ os.git_revision }} + git checkout -f --detach {{ os.git_revision }} + popd + + # Install unity-downloader-cli and unity-config +{% if agent.os == "win" -%} + - | + where /q gsudo.exe && set CMD_ADMIN=gsudo.exe + %CMD_ADMIN% choco source add --priority 1 -n Unity -s {{ registry.artifactory }}/api/nuget/unity-choco-local + %CMD_ADMIN% choco install unity-config -y + %CMD_ADMIN% choco install unity-downloader-cli -y +{% elsif agent.os == "mac" -%} + - brew tap --force-auto-update unity/unity git@github.cds.internal.unity3d.com:unity/homebrew-unity.git + - brew install unity-config +{% endif -%} + + # Install UnifiedTestRunner +{% if agent.os == "win" -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr.bat --output {{ os.tool_utr }} +{% else -%} + - curl -s --show-error --retry 15 {{ registry.artifactory }}/unity-tools-local/utr-standalone/utr --output {{ os.tool_utr }} + - chmod +x {{ os.tool_utr }} +{% endif -%} + + # Install Unity Editor and required components + - unity-downloader-cli -u {{ editor }} -c Editor -c {{ platform.component }} -w --fast + + # Create test project + - | + unity-config project create {{ job_project_path }} + unity-config project add testable com.unity.cloud.gltfast + unity-config project add dependency com.unity.cloud.gltfast@file:./../../../Packages/gltfast + unity-config project add dependency {{ test_framework }} -p {{ job_project_path }} +{% for dep in test_dependencies -%} + unity-config project add dependency {{ dep.id }}@{{ dep.version }} -p {{ job_project_path }} +{% endfor -%} + +{% capture results_path -%}{{ os.yamato_source_dir }}/test-results~/com.unity.cloud.gltfast/{{ platform_id }}/{{ editor }}/{{ test_setup.project_setup }}{% endcapture -%} + + # Apply project setup + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.ApplySetup glTFastSetup:{{ test_setup.project_setup }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log + +{% if test_setup.render_pipeline -%} + # Apply render pipeline asset + - > + {{ editor_exe }} + -projectPath {{ job_project_path }} + -executeMethod GLTFast.Editor.Tests.SetupProject.SetRenderPipeline SRP:{{ test_setup.render_pipeline }} + -upmNoDefaultPackages + -enablePackageManagerTraces + -batchmode + -quit + -logFile {{ results_path }}/UnityProjectSetup.log +{% endif -%} + +{% if platform_id == "android" and platform.run == "shield" -%} +{% assign androidUrlPrefix = "https://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!" -%} + - | + set ANDROID_DEVICE_CONNECTION={{ os.bokken_host_ip }}; + wget {{ androidUrlPrefix }}/adbkey.pub -O %USERPROFILE%/.android/adbkey.pub + wget {{ androidUrlPrefix }}/adbkey -O %USERPROFILE%/.android/adbkey + gsudo NetSh Advfirewall set allprofiles state off + "%ANDROID_SDK_ROOT%\platform-tools\adb.exe" connect {{ os.bokken_host_ip }} +{% endif -%} + + # Run Tests + # TODO: upm-ci rocks UPM and other cache directories. Maybe we can speed things up this way as well. + # TODO: DISABLE_SUB_PACKAGE_LOAD is required for 2020 only. Eventually remove all occurrences. + - > +{% if agent.os == "win" -%} + set GLTF_TEST_ASSET_DIR={{ os.yamato_source_dir }}\Assets + + set DISABLE_SUB_PACKAGE_LOAD=TRUE +{% else -%} + export GLTF_TEST_ASSET_DIR="{{ os.yamato_source_dir }}/Assets" + + export DISABLE_SUB_PACKAGE_LOAD=TRUE +{% endif -%} + + {{ os.tool_utr }} + --testproject={{ job_project_path }} + --editor-location=.Editor + --artifacts_path={{ results_path }} + --reruncount=2 + --verbose + --extra-editor-arg="-enablePackageManagerTraces -upmNoDefaultPackages" + --suite=playmode + --scripting-backend=Il2Cpp + --platform={% if platform.platform -%}{{ platform.platform }}{% else -%}{{ platform_id }}{% endif %} + --player-load-path={{ results_path }}/player +{% if platform_id == "android" and platform.run == "shield" -%} + --player-connection-ip={{ os.bokken_host_ip }} +{% endif -%} +{% if platform.build -%} + dependencies: + - .yamato/project-test.yml#build_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }} +{% endif -%} +{{ job_artifacts }} +{% endif -%} + {% endfor -%} {% endfor -%} @@ -163,7 +608,9 @@ tests_{{ test_setup.project_setup }}_all: dependencies: {% for editor in editor_versions -%} {% for platform_id in platform_ids -%} +{% if platforms[platform_id].test -%} - .yamato/project-test.yml#test_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }} +{% endif -%} {% endfor -%} {% endfor -%} @@ -174,8 +621,31 @@ tests_{{ test_setup.project_setup }}_pr: - .yamato/project-test.yml#test_{{ test_setup.project_setup }}_{{ pr_set.platform }}_{{ pr_set.editor }} {% endfor -%} +build_and_run_{{ test_setup.project_setup }}_all: + name: Build and run all {{ test_setup.project_setup }} + dependencies: +{% for editor in editor_versions -%} +{% for platform_id in platform_ids -%} +{% if platforms[platform_id].build_and_run -%} + - .yamato/project-test.yml#build_and_run_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }} +{% elsif platforms[platform_id].run -%} + - .yamato/project-test.yml#run_{{ test_setup.project_setup }}_{{ platform_id }}_{{ editor }} +{% endif -%} +{% endfor -%} {% endfor -%} +build_and_run_{{ test_setup.project_setup }}_pr: + name: Build and run PR subset {{ test_setup.project_setup }} + dependencies: +{% for pr_set in test_setup.pr_sets -%} +{% if platforms[pr_set.platform].build_and_run -%} + - .yamato/project-test.yml#build_and_run_{{ test_setup.project_setup }}_{{ pr_set.platform }}_{{ pr_set.editor }} +{% elsif platforms[pr_set.platform].run -%} + - .yamato/project-test.yml#run_{{ test_setup.project_setup }}_{{ pr_set.platform }}_{{ pr_set.editor }} +{% endif -%} +{% endfor -%} + +{% endfor -%} tests_all: name: Test all @@ -190,3 +660,26 @@ tests_pr: {% for test_setup in test_setups -%} - .yamato/project-test.yml#tests_{{ test_setup.project_setup }}_pr {% endfor -%} + +build_and_run_all: + name: Build and run all + dependencies: +{% for test_setup in test_setups -%} + - .yamato/project-test.yml#build_and_run_{{ test_setup.project_setup }}_all +{% endfor -%} + +build_and_run_pr: + name: Build and run PR subsets + dependencies: +{% for test_setup in test_setups -%} + - .yamato/project-test.yml#build_and_run_{{ test_setup.project_setup }}_pr +{% endfor -%} + +coverage_all: + name: Coverage All + dependencies: +{% for test_setup in test_setups -%} +{% for coverage_set in test_setup.coverage_sets -%} + - .yamato/project-test.yml#test_{{ test_setup.project_setup }}_{{ coverage_set.platform }}_{{ coverage_set.editor }} +{% endfor -%} +{% endfor -%} diff --git a/.yamato/triggers.yml b/.yamato/triggers.yml index 0bf68134..34064ff0 100644 --- a/.yamato/triggers.yml +++ b/.yamato/triggers.yml @@ -10,8 +10,8 @@ pr_trigger: dependencies: - .yamato/code-format-check.yml#code_format_check - .yamato/package-test.yml#tests_pr - - .yamato/package-player-test.yml#player_test_pr - .yamato/project-test.yml#tests_pr + - .yamato/project-test.yml#build_and_run_pr tests_all_trigger: name: _Tests All @@ -21,8 +21,8 @@ tests_all_trigger: pull_request.comment eq "all" dependencies: - .yamato/package-test.yml#tests_all - - .yamato/package-player-test.yml#player_test_all - .yamato/project-test.yml#tests_all + - .yamato/project-test.yml#build_and_run_all tests_all_weekly: name: _Tests All [Weekly] @@ -42,4 +42,4 @@ post_merge_trigger: triggers: expression: push.branch eq "develop" dependencies: - - .yamato/project-test.yml#tests_pr + - .yamato/project-test.yml#coverage_all diff --git a/Tests/Editor/PreprocessBuild.cs b/Tests/Editor/PreprocessBuild.cs index c15ca7e4..1c7308bc 100644 --- a/Tests/Editor/PreprocessBuild.cs +++ b/Tests/Editor/PreprocessBuild.cs @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the Draco for Unity authors // SPDX-License-Identifier: Apache-2.0 +using System; using System.Collections.Generic; using System.IO; using GLTFast.Tests.Export; @@ -11,6 +12,7 @@ using UnityEngine; using UnityEngine.Assertions; using UnityEngine.Rendering; +using Object = UnityEngine.Object; namespace GLTFast.Editor.Tests { @@ -52,9 +54,9 @@ static void SyncTestAssets() AssetDatabase.Refresh(); } - static IEnumerable IterateAssets(string inPackageLocation) where T : Object + static IEnumerable IterateAssets(string inPackageLocation, string name = null) where T : Object { - var guids = FindAssets($"t:{typeof(T).Name}", inPackageLocation); + var guids = FindAssets($"t:{typeof(T).Name} {name ?? ""}", inPackageLocation); if (guids == null || guids.Length < 1) { throw new InvalidDataException($"No {typeof(T).Name} asset set was found in {inPackageLocation}!"); @@ -67,7 +69,27 @@ static void SyncTestAssets() static IEnumerable IterateAllShaderVariantCollections() { - foreach (var collection in IterateAssets("Tests/Runtime/TestCaseSets")) + string name; + switch (RenderPipelineUtils.RenderPipeline) + { + case RenderPipeline.BuiltIn: + name = "birp"; + break; + case RenderPipeline.HighDefinition: + name = "hdrp"; + break; + case RenderPipeline.Unknown: + case RenderPipeline.Universal: + default: +#if UNITY_2021_2_OR_NEWER + name = "urp.12"; +#else + name = "urp.10"; +#endif + break; + } + + foreach (var collection in IterateAssets("Tests/Runtime/TestCaseSets", name)) { yield return collection; } diff --git a/Tests/Editor/SetupProject.cs b/Tests/Editor/SetupProject.cs index 562e0902..3d52dd65 100644 --- a/Tests/Editor/SetupProject.cs +++ b/Tests/Editor/SetupProject.cs @@ -1,18 +1,28 @@ // SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 +#if USING_URP +#define USING_SRP +#endif + using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using UnityEditor; using UnityEditor.PackageManager; using UnityEngine; +#if USING_SRP +using UnityEngine.Rendering; +#endif namespace GLTFast.Editor.Tests { static class SetupProject { + const string k_RenderPipelineAssetsPath = "Packages/com.unity.cloud.gltfast/Tests/Runtime/RenderPipelineAssets/"; + static readonly Dictionary k_ProjectSetups = new Dictionary { ["default"] = new ProjectSetup( @@ -80,6 +90,35 @@ public static async void ApplySetup() } } } + + public static void SetRenderPipeline() + { + var args = Environment.GetCommandLineArgs(); + foreach (var arg in args) + { + const string prefix = "SRP:"; + if (arg.StartsWith(prefix)) + { + var subPath = arg.Substring(prefix.Length); + var assetPath = $"{k_RenderPipelineAssetsPath}{subPath}.asset"; +#if USING_SRP + var asset = AssetDatabase.LoadAssetAtPath(assetPath); + if (asset == null) + { + throw new InvalidDataException($"Could not find render pipeline asset at {subPath}."); + } + Debug.Log($"Set default render pipeline to {subPath}"); + GraphicsSettings.defaultRenderPipeline = asset; + break; +#else + throw new InvalidOperationException( + $"Could not set render pipeline asset ({subPath}): No SRP package installed"); +#endif + } + } + + + } } class ProjectSetup diff --git a/Tests/Editor/glTFast.Editor.Tests.asmdef b/Tests/Editor/glTFast.Editor.Tests.asmdef index 2c9a0973..7047199b 100644 --- a/Tests/Editor/glTFast.Editor.Tests.asmdef +++ b/Tests/Editor/glTFast.Editor.Tests.asmdef @@ -7,7 +7,8 @@ "glTFast", "Unity.Mathematics", "glTFast.Tests", - "glTFast.Editor" + "glTFast.Editor", + "Unity.RenderPipelines.Universal.Runtime" ], "includePlatforms": [ "Editor" @@ -22,6 +23,12 @@ "defineConstraints": [ "UNITY_INCLUDE_TESTS" ], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.render-pipelines.universal", + "expression": "", + "define": "USING_URP" + } + ], "noEngineReferences": false } \ No newline at end of file diff --git a/Tests/Runtime/RenderPipelineAssets.meta b/Tests/Runtime/RenderPipelineAssets.meta new file mode 100644 index 00000000..e48d1a80 --- /dev/null +++ b/Tests/Runtime/RenderPipelineAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c70afc6fc28374eaa80d7b0ddc984340 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset new file mode 100644 index 00000000..41d656db --- /dev/null +++ b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} + m_Name: URP-Forward + m_EditorClassIdentifier: + k_AssetVersion: 12 + k_AssetPreviousVersion: 12 + m_RendererType: 1 + m_RendererData: {fileID: 0} + m_RendererDataList: + - {fileID: 11400000, guid: 51269a86215e84a488638eeb76979978, type: 2} + m_DefaultRendererIndex: 0 + m_RequireDepthTexture: 0 + m_RequireOpaqueTexture: 0 + m_OpaqueDownsampling: 1 + m_SupportsTerrainHoles: 1 + m_SupportsHDR: 1 + m_HDRColorBufferPrecision: 0 + m_MSAA: 1 + m_RenderScale: 1 + m_UpscalingFilter: 0 + m_FsrOverrideSharpness: 0 + m_FsrSharpness: 0.92 + m_EnableLODCrossFade: 1 + m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 + m_LightProbeSystem: 0 + m_ProbeVolumeMemoryBudget: 1024 + m_ProbeVolumeBlendingMemoryBudget: 256 + m_SupportProbeVolumeGPUStreaming: 0 + m_SupportProbeVolumeDiskStreaming: 0 + m_SupportProbeVolumeScenarios: 0 + m_SupportProbeVolumeScenarioBlending: 0 + m_ProbeVolumeSHBands: 1 + m_MainLightRenderingMode: 1 + m_MainLightShadowsSupported: 1 + m_MainLightShadowmapResolution: 2048 + m_AdditionalLightsRenderingMode: 1 + m_AdditionalLightsPerObjectLimit: 4 + m_AdditionalLightShadowsSupported: 0 + m_AdditionalLightsShadowmapResolution: 512 + m_AdditionalLightsShadowResolutionTierLow: 128 + m_AdditionalLightsShadowResolutionTierMedium: 256 + m_AdditionalLightsShadowResolutionTierHigh: 512 + m_ReflectionProbeBlending: 0 + m_ReflectionProbeBoxProjection: 0 + m_ShadowDistance: 50 + m_ShadowCascadeCount: 1 + m_Cascade2Split: 0.25 + m_Cascade3Split: {x: 0.1, y: 0.3} + m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} + m_CascadeBorder: 0.1 + m_ShadowDepthBias: 1 + m_ShadowNormalBias: 1 + m_AnyShadowsSupported: 1 + m_SoftShadowsSupported: 0 + m_ConservativeEnclosingSphere: 0 + m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 + m_AdditionalLightsCookieResolution: 2048 + m_AdditionalLightsCookieFormat: 3 + m_UseSRPBatcher: 1 + m_SupportsDynamicBatching: 0 + m_MixedLightingSupported: 1 + m_SupportsLightCookies: 1 + m_SupportsLightLayers: 0 + m_DebugLevel: 0 + m_StoreActionsOptimization: 0 + m_UseAdaptivePerformance: 1 + m_ColorGradingMode: 0 + m_ColorGradingLutSize: 32 + m_UseFastSRGBLinearConversion: 0 + m_SupportDataDrivenLensFlare: 1 + m_SupportScreenSpaceLensFlare: 1 + m_GPUResidentDrawerMode: 0 + m_SmallMeshScreenPercentage: 0 + m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0 + m_ShadowType: 1 + m_LocalShadowsSupported: 0 + m_LocalShadowsAtlasResolution: 256 + m_MaxPixelLights: 0 + m_ShadowAtlasResolution: 256 + m_VolumeFrameworkUpdateMode: 0 + m_VolumeProfile: {fileID: 0} + apvScenesData: + obsoleteSceneBounds: + m_Keys: [] + m_Values: [] + obsoleteHasProbeVolumes: + m_Keys: [] + m_Values: + m_PrefilteringModeMainLightShadows: 1 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 1 + m_PrefilterXRKeywords: 0 + m_PrefilteringModeForwardPlus: 1 + m_PrefilteringModeDeferredRendering: 1 + m_PrefilteringModeScreenSpaceOcclusion: 1 + m_PrefilterDebugKeywords: 0 + m_PrefilterWriteRenderingLayers: 0 + m_PrefilterHDROutput: 0 + m_PrefilterSSAODepthNormals: 0 + m_PrefilterSSAOSourceDepthLow: 0 + m_PrefilterSSAOSourceDepthMedium: 0 + m_PrefilterSSAOSourceDepthHigh: 0 + m_PrefilterSSAOInterleaved: 0 + m_PrefilterSSAOBlueNoise: 0 + m_PrefilterSSAOSampleCountLow: 0 + m_PrefilterSSAOSampleCountMedium: 0 + m_PrefilterSSAOSampleCountHigh: 0 + m_PrefilterDBufferMRT1: 0 + m_PrefilterDBufferMRT2: 0 + m_PrefilterDBufferMRT3: 0 + m_PrefilterSoftShadowsQualityLow: 0 + m_PrefilterSoftShadowsQualityMedium: 0 + m_PrefilterSoftShadowsQualityHigh: 0 + m_PrefilterSoftShadows: 0 + m_PrefilterScreenCoord: 0 + m_PrefilterNativeRenderPass: 0 + m_PrefilterUseLegacyLightmaps: 0 + m_ShaderVariantLogLevel: 0 + m_ShadowCascades: 0 + m_Textures: + blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} + bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} diff --git a/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset.meta b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset.meta new file mode 100644 index 00000000..1f2cb25a --- /dev/null +++ b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e2091af073eb4441087fee3a72159e67 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset b/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset new file mode 100644 index 00000000..66b5cb00 --- /dev/null +++ b/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} + m_Name: URP-Forward_Renderer + m_EditorClassIdentifier: + m_RendererFeatures: [] + m_RendererFeatureMap: + postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + shaders: + blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} + copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} + screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, type: 3} + samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} + tileDepthInfoPS: {fileID: 0} + tileDeferredPS: {fileID: 0} + stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} + fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} + materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} + m_OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_DefaultStencilState: + overrideStencilState: 0 + stencilReference: 0 + stencilCompareFunction: 8 + passOperation: 2 + failOperation: 0 + zFailOperation: 0 + m_ShadowTransparentReceive: 1 + m_RenderingMode: 0 + m_AccurateGbufferNormals: 0 diff --git a/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset.meta b/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset.meta new file mode 100644 index 00000000..b4ec54f2 --- /dev/null +++ b/Tests/Runtime/RenderPipelineAssets/URP-Forward_Renderer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51269a86215e84a488638eeb76979978 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Export/ExportTests.cs b/Tests/Runtime/Scripts/Export/ExportTests.cs index 279f21a0..1d1e3889 100644 --- a/Tests/Runtime/Scripts/Export/ExportTests.cs +++ b/Tests/Runtime/Scripts/Export/ExportTests.cs @@ -5,6 +5,10 @@ #define LOCAL_LOADING #endif +#if UNITY_EDITOR +#define LOAD_REFERENCE_SYNC +#endif + using System; using System.Collections; using System.IO; @@ -677,11 +681,10 @@ static async Task ExportSceneGameObject(GameObject gameObject, bool binary, bool if (!binary) { -#if UNITY_EDITOR - AssertGltfJson(fileName, path); -#else - await AssertGltfJson(fileName, path); +#if !LOAD_REFERENCE_SYNC + await #endif + AssertGltfJson(fileName, path); } #if GLTF_VALIDATOR && UNITY_EDITOR @@ -694,11 +697,12 @@ static async Task ExportSceneGameObject(GameObject gameObject, bool binary, bool #endif } -#if UNITY_EDITOR - static void AssertGltfJson(string testName, string resultPath) +#if LOAD_REFERENCE_SYNC + static void #else - static async Task AssertGltfJson(string testName, string resultPath) + static async Task #endif + AssertGltfJson(string testName, string resultPath) { var renderPipeline = RenderPipelineUtils.RenderPipeline; @@ -716,7 +720,7 @@ static async Task AssertGltfJson(string testName, string resultPath) break; } -#if UNITY_EDITOR +#if LOAD_REFERENCE_SYNC var pathPrefix = $"Packages/{GltfGlobals.GltfPackageName}/Tests/Resources/ExportTargets"; TryFixPackageAssetPath(ref pathPrefix); @@ -730,21 +734,7 @@ static async Task AssertGltfJson(string testName, string resultPath) } var targetJson = targetJsonAsset.text; #else - var path = Path.Combine(Application.streamingAssetsPath, $"{exportTargetFolder}{rpSubfolder}/{testName}.txt"); -#if LOCAL_LOADING - path = $"file://{path}"; -#endif - var request = UnityWebRequest.Get(path); - - var x = request.SendWebRequest(); - while (!x.isDone) - { - await Task.Yield(); - } - - Assert.IsNull(request.error, $"Target glTF JSON for {testName} was not found at {path}: {request.error}"); - - var targetJson = request.downloadHandler.text; + var targetJson = await LoadGltfJsonReference(testName, rpSubfolder); #endif CompareGltfJsonTokenRecursively( @@ -753,6 +743,38 @@ static async Task AssertGltfJson(string testName, string resultPath) ); } +#if !LOAD_REFERENCE_SYNC + static async Task LoadGltfJsonReference(string testName, string rpSubfolder) + { + while (true) + { + var path = Path.Combine(Application.streamingAssetsPath, $"{exportTargetFolder}{rpSubfolder}/{testName}.txt"); +#if LOCAL_LOADING + path = $"file://{path}"; +#endif + var request = UnityWebRequest.Get(path); + + var x = request.SendWebRequest(); + while (!x.isDone) + { + await Task.Yield(); + } + + if (request.error != null && !string.IsNullOrEmpty(rpSubfolder)) + { + // Fallback to BuiltIn reference + rpSubfolder = ""; + continue; + } + + Assert.IsNull(request.error, $"Target glTF JSON for {testName} was not found at {path}: {request.error}"); + + var targetJson = request.downloadHandler.text; + return targetJson; + } + } +#endif + static void CompareGltfJsonTokenRecursively(JToken tokenA, JToken tokenB) { diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants b/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants new file mode 100644 index 00000000..5e110ced --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants @@ -0,0 +1,55 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-test-models-hdrp + m_Shaders: + - first: {fileID: 4800000, guid: 4340a3cf1cde6416d957808a6ac79eed, type: 3} + second: + variants: + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT LIGHTPROBE_SH MATERIAL_QUALITY_HIGH + SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_FPTL_LIGHTLIST + passType: 0 + - first: {fileID: -6465566751694194690, guid: c87047c884d9843f5b0f4cce282aa760, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + passType: 8 + - keywords: _BLENDMODE_OFF + passType: 8 + - keywords: _BLENDMODE_OFF _ENABLE_FOG_ON_TRANSPARENT _SURFACE_TYPE_TRANSPARENT + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST + passType: 13 + - keywords: _BLENDMODE_OFF + passType: 13 + - keywords: _BLENDMODE_OFF _ENABLE_FOG_ON_TRANSPARENT _SURFACE_TYPE_TRANSPARENT + passType: 13 + - first: {fileID: -6465566751694194690, guid: b9d29dfa1474148e792ac720cbd45122, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + passType: 8 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 8 + - keywords: _BLENDMODE_OFF _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants.meta new file mode 100644 index 00000000..958cd922 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-hdrp.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5043a06d4e0744e1585656970616eaeb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants new file mode 100644 index 00000000..81e12d11 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-test-models-urp.10 + m_Shaders: + - first: {fileID: 4800000, guid: 4340a3cf1cde6416d957808a6ac79eed, type: 3} + second: + variants: + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + passType: 0 + - first: {fileID: -6465566751694194690, guid: 81efe6bcd8aa64c21b80376f539ee767, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: + passType: 8 + - keywords: + passType: 13 + - first: {fileID: -6465566751694194690, guid: 90c26dfde11bf4ff69ef936c6e6b1ed1, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: + passType: 13 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS _DEPTH_NO_MSAA + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _DEPTH_NO_MSAA + passType: 13 + - first: {fileID: -6465566751694194690, guid: ba6d401c74b2c4f96af7edf0fe32241e, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: + passType: 13 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + passType: 13 + - first: {fileID: -6465566751694194690, guid: f94bbd13412a4419bbfac24d9a53b058, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: + passType: 8 + - keywords: + passType: 13 + - first: {fileID: -6465566751694194690, guid: 42aa4553160a34cf08f29a15eea9eb3b, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: + passType: 8 + - keywords: + passType: 13 + - first: {fileID: -6465566751694194690, guid: 28efc76bda49d4bae9db32ea2079d3c0, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: + passType: 8 + - keywords: + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants.meta new file mode 100644 index 00000000..a5cb4617 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.10.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e133a6f9f77614b62ac8e8b6703c57e8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants new file mode 100644 index 00000000..ecf7999d --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants @@ -0,0 +1,39 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-test-models-urp.12 + m_Shaders: + - first: {fileID: -6465566751694194690, guid: c87047c884d9843f5b0f4cce282aa760, + type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: _ALPHATEST_ON + passType: 0 + - keywords: _SURFACE_TYPE_TRANSPARENT + passType: 0 + - keywords: + passType: 8 + - keywords: _ALPHATEST_ON + passType: 8 + - keywords: + passType: 13 + - first: {fileID: -6465566751694194690, guid: b9d29dfa1474148e792ac720cbd45122, + type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE + _SHADOWS_SOFT + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants.meta new file mode 100644 index 00000000..635ab65a --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-test-models-urp.12.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1dadfc588ab1435fa1009e310a81fda +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: From d63e8cf6fb2a4d5efbf13676e5ed0f3404d90c01 Mon Sep 17 00:00:00 2001 From: Alex Huot Date: Thu, 28 Mar 2024 18:15:26 -0400 Subject: [PATCH 03/10] Adding Apple Manifest (#118) --- CHANGELOG.md | 1 + Plugins.meta | 8 ++ Plugins/UnityCloudGltfast.xcprivacy | 5 ++ Plugins/UnityCloudGltfast.xcprivacy.meta | 93 ++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 Plugins.meta create mode 100644 Plugins/UnityCloudGltfast.xcprivacy create mode 100644 Plugins/UnityCloudGltfast.xcprivacy.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8dfb5c..e35ceb88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Runtime import tests. - Runtime export tests. - (Export) Added development-time checks for valid JSON string literals. +- Added Apple Privacy Manifest file to `/Plugins` directory. ## Changed - Refactored test scripts folder layout. diff --git a/Plugins.meta b/Plugins.meta new file mode 100644 index 00000000..603a5420 --- /dev/null +++ b/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7a1fc1b5178b48c4abaaf7a38eb9d7d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Plugins/UnityCloudGltfast.xcprivacy b/Plugins/UnityCloudGltfast.xcprivacy new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/Plugins/UnityCloudGltfast.xcprivacy @@ -0,0 +1,5 @@ + + + + + diff --git a/Plugins/UnityCloudGltfast.xcprivacy.meta b/Plugins/UnityCloudGltfast.xcprivacy.meta new file mode 100644 index 00000000..6028a568 --- /dev/null +++ b/Plugins/UnityCloudGltfast.xcprivacy.meta @@ -0,0 +1,93 @@ +fileFormatVersion: 2 +guid: be44ec34bf0bd465eafeb36d836c9015 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude VisionOS: 0 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + VisionOS: VisionOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 1 + settings: + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: From 87c0727726f096329b2b065fe671a108f53f44fb Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 10 Apr 2024 15:10:44 +0200 Subject: [PATCH 04/10] fix: visionOS compatible shader sub graphs. (#120) * fix: BaseColor sub graph uses built-in shader define `UNITY_COLORSPACE_GAMMA` for project color space detection (replacing a custom function node). * fix: Emission sub graph uses shader define `UNITY_HEADER_HD_INCLUDED` for HDRP usage detection (replacing a custom function node). --- CHANGELOG.md | 8 + .../Shader/SubGraphs/BaseColor.shadersubgraph | 2185 ++++++++++++++++- .../Shader/SubGraphs/Emission.shadersubgraph | 407 +-- 3 files changed, 2272 insertions(+), 328 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e35ceb88..074479b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- *Emission* sub graph uses shader define [`UNITY_HEADER_HD_INCLUDED`](https://forum.unity.com/threads/deploying-for-multiple-rp.1342277/) for HDRP usage detection (replacing a custom function node). +- *BaseColor* sub graph uses built-in shader define [`UNITY_COLORSPACE_GAMMA`](https://docs.unity3d.com/ScriptReference/Rendering.BuiltinShaderDefine.UNITY_COLORSPACE_GAMMA.html) for project color space detection (replacing a custom function node). + +### Fixed +- Shader sub graphs *BaseColor* and *Emission* are now compatible with [PolySpatial visionOS][PolySpatialVisionOS]. + ## [6.3.0] - 2024-03-27 ## Added @@ -1110,6 +1117,7 @@ This release contains multiple breaking changes. Please read the [upgrade guide] [DanDovi]: https://github.com/DanDovi [DracoForUnity]: https://docs.unity3d.com/Packages/com.unity.cloud.draco@latest [DracoUnity]: https://github.com/atteneder/DracoUnity +[PolySpatialVisionOS]: https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@latest/ [aurorahcx]: https://github.com/aurorahcx [Battlehub0x]: https://github.com/Battlehub0x [Bersaelor]: https://github.com/Bersaelor diff --git a/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph b/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph index 9c3a35b5..e2cfa08b 100644 --- a/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph +++ b/Runtime/Shader/SubGraphs/BaseColor.shadersubgraph @@ -1,226 +1,327 @@ { - "m_SerializedProperties": [ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "090ef440380b46d986517b7922b4a7a6", + "m_Properties": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.Internal.Vector4ShaderProperty" - }, - "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"f5db2ecb-d689-4602-9dd9-c4f655fb7c41\"\n },\n \"m_Name\": \"baseColorFactor\",\n \"m_DefaultReferenceName\": \"Vector4_FC55EA20\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": {\n \"x\": 1.0,\n \"y\": 1.0,\n \"z\": 1.0,\n \"w\": 1.0\n }\n}" + "m_Id": "bbcb866077389285b6753f7439d8cefe" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty" - }, - "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"24774c64-81a9-401f-8e9b-8e59a366a8a4\"\n },\n \"m_Name\": \"baseColorTexture\",\n \"m_DefaultReferenceName\": \"Texture2D_FA7B3822\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": {\n \"m_SerializedTexture\": \"{\\\"texture\\\":{\\\"instanceID\\\":0}}\",\n \"m_Guid\": \"\"\n },\n \"m_Modifiable\": true,\n \"m_DefaultType\": 0\n}" + "m_Id": "f5798993603c168f9f2f35781e76f32d" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty" - }, - "JSONnodeData": "{\n \"m_Guid\": {\n \"m_GuidSerialized\": \"6b928d43-ab83-47b1-a6e7-31c648717852\"\n },\n \"m_Name\": \"UV\",\n \"m_DefaultReferenceName\": \"Vector2_8D613221\",\n \"m_OverrideReferenceName\": \"\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Precision\": 0,\n \"m_GPUInstanced\": false,\n \"m_Hidden\": false,\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 0.0,\n \"z\": 0.0,\n \"w\": 0.0\n }\n}" + "m_Id": "ce8f6554e8d0508f97307598c2be7200" } ], - "m_SerializedKeywords": [], - "m_SerializableNodes": [ + "m_Keywords": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.SubGraphOutputNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"d7add9a6-90d6-4bb3-81ab-1d67fb79b97c\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Out_Vector1\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 875.0000610351563,\n \"y\": -69.99999237060547,\n \"width\": 134.0,\n \"height\": 101.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"baseColor\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"baseColor\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "77b0beb4204941d6abdcb8dad422f287" + } + ], + "m_Nodes": [ + { + "m_Id": "9200da3e7096bf8392d845cdedd5c693" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.MultiplyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"40fd538b-0379-4e83-b07f-8ce6dc7258a9\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 439.0000305175781,\n \"y\": -215.99998474121095,\n \"width\": 129.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "f0ce3c0288153f81ba18d523e8384d3a" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.VertexColorNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"bb63243d-9fcf-4703-b4d2-c364866852cb\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Vertex Color\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -145.0,\n \"y\": -423.0,\n \"width\": 135.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 1.0,\\n \\\"y\\\": 1.0,\\n \\\"z\\\": 1.0,\\n \\\"w\\\": 1.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "2fef576ae48fe28095765de08d6a7dd5" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.MultiplyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"8d64f47c-32e4-4253-a51e-fc07b035423d\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 173.00001525878907,\n \"y\": -160.99998474121095,\n \"width\": 208.0,\n \"height\": 302.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": -2.380000114440918,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "a11bb30953bafd8285f837d1caecc92d" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.SampleTexture2DNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"08206f4f-3fef-4186-80bf-cfab95c6a2cd\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Sample Texture 2D\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -349.0,\n \"y\": -99.0,\n \"width\": 208.0,\n \"height\": 433.0000305175781\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"RGBA\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGBA\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DInputMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Texture\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Texture\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Texture\\\": {\\n \\\"m_SerializedTexture\\\": \\\"{\\\\\\\"texture\\\\\\\":{\\\\\\\"instanceID\\\\\\\":0}}\\\",\\n \\\"m_Guid\\\": \\\"\\\"\\n },\\n \\\"m_DefaultType\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.UVMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"UV\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"UV\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ],\\n \\\"m_Channel\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.SamplerStateMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Sampler\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sampler\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_TextureType\": 0,\n \"m_NormalMapSpace\": 0\n}" + "m_Id": "138397a6db27508ebfa37e627012b311" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.PropertyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"1907e358-b959-4954-a1db-e2d0c1b1ce01\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -557.0,\n \"y\": -122.0,\n \"width\": 163.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"baseColorFactor\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"f5db2ecb-d689-4602-9dd9-c4f655fb7c41\"\n}" + "m_Id": "5ecedb8c4fe0638ebff5724112c3cda5" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.PropertyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"e122900f-bbbe-42d7-8b29-71a72126adf2\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -562.0000610351563,\n \"y\": -58.000003814697269,\n \"width\": 178.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Texture2DMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"baseColorTexture\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"24774c64-81a9-401f-8e9b-8e59a366a8a4\"\n}" + "m_Id": "253666f2e2fab1808ed872dbfb33b5fa" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.PropertyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"ee14b98e-7fbd-443b-8c6b-768dad7fff71\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -562.0000610351563,\n \"y\": -18.00002670288086,\n \"width\": 91.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"UV\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_PropertyGuidSerialized\": \"6b928d43-ab83-47b1-a6e7-31c648717852\"\n}" + "m_Id": "4ea0ba4a4540b98986b662b0e34c9d44" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.SplitNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"cfaa60d3-b834-4f33-95ef-2b375ab2e325\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Split\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -277.00006103515627,\n \"y\": -313.0000305175781,\n \"width\": 120.00000762939453,\n \"height\": 149.00001525878907\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "450ef2bb19756486a3df6a4dc6eb7507" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.MultiplyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"12027236-a59c-4009-b39d-139fed55e3d1\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 175.0,\n \"y\": 152.99998474121095,\n \"width\": 129.0,\n \"height\": 118.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.CustomFunctionNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"fffca6f9-3461-48b9-98ed-04d768ad5132\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Custom Function\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 249.0,\n \"y\": -438.9999694824219,\n \"width\": 162.0,\n \"height\": 118.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Gamma\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Gamma\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Linear\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Linear\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SourceType\": 1,\n \"m_FunctionName\": \"ProjectColorSpace\",\n \"m_FunctionSource\": \"\",\n \"m_FunctionBody\": \"#if defined(UNITY_COLORSPACE_GAMMA)\\n Out = Gamma;\\n#else\\n Out = Linear;\\n#endif\"\n}" + "m_Id": "b387cfe84ba48c80b009292201f697eb" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.SplitNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"bf760e52-0ed0-4e3f-9548-543942579ff9\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Split\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 254.99996948242188,\n \"y\": -317.0,\n \"width\": 120.99999237060547,\n \"height\": 149.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "2a101c899ff69481b176e85319651599" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.MultiplyNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"3aa17cce-5282-4293-bfe4-1d0a9bbba26b\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Multiply\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 448.0,\n \"y\": 103.0000228881836,\n \"width\": 130.0,\n \"height\": 118.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" + "m_Id": "5b7cc1ccc3c2cc8e9b782803430a5ba4" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.ColorspaceConversionNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"cf003b92-5eaa-4242-a925-2bd67b183f97\",\n \"m_GroupGuidSerialized\": \"f6d97679-b47f-41f2-ad84-efd5b5f49fe6\",\n \"m_Name\": \"Colorspace Conversion\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 14.000005722045899,\n \"y\": -519.0,\n \"width\": 211.00001525878907,\n \"height\": 131.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": false,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Conversion\": {\n \"from\": 1,\n \"to\": 0\n }\n}" + "m_Id": "694a11edcfc84825b16012f21ea98bfb" } ], - "m_Groups": [ + "m_GroupDatas": [ { - "m_GuidSerialized": "f6d97679-b47f-41f2-ad84-efd5b5f49fe6", - "m_Title": "BaseColor", - "m_Position": { - "x": -374.0, - "y": -608.0 - } + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" } ], - "m_StickyNotes": [], - "m_SerializableEdges": [ + "m_StickyNoteDatas": [], + "m_Edges": [ { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" + }, + "m_SlotId": 2 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"8d64f47c-32e4-4253-a51e-fc07b035423d\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"40fd538b-0379-4e83-b07f-8ce6dc7258a9\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "2a101c899ff69481b176e85319651599" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"e122900f-bbbe-42d7-8b29-71a72126adf2\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"08206f4f-3fef-4186-80bf-cfab95c6a2cd\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "a11bb30953bafd8285f837d1caecc92d" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 7 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"ee14b98e-7fbd-443b-8c6b-768dad7fff71\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"08206f4f-3fef-4186-80bf-cfab95c6a2cd\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "253666f2e2fab1808ed872dbfb33b5fa" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"1907e358-b959-4954-a1db-e2d0c1b1ce01\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"cfaa60d3-b834-4f33-95ef-2b375ab2e325\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "2a101c899ff69481b176e85319651599" + }, + "m_SlotId": 2 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 4,\n \"m_NodeGUIDSerialized\": \"cfaa60d3-b834-4f33-95ef-2b375ab2e325\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"12027236-a59c-4009-b39d-139fed55e3d1\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "9200da3e7096bf8392d845cdedd5c693" + }, + "m_SlotId": 2 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "2fef576ae48fe28095765de08d6a7dd5" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 7,\n \"m_NodeGUIDSerialized\": \"08206f4f-3fef-4186-80bf-cfab95c6a2cd\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"12027236-a59c-4009-b39d-139fed55e3d1\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "5b7cc1ccc3c2cc8e9b782803430a5ba4" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "2fef576ae48fe28095765de08d6a7dd5" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"bb63243d-9fcf-4703-b4d2-c364866852cb\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"bf760e52-0ed0-4e3f-9548-543942579ff9\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "694a11edcfc84825b16012f21ea98bfb" + }, + "m_SlotId": 2 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "2fef576ae48fe28095765de08d6a7dd5" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"12027236-a59c-4009-b39d-139fed55e3d1\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"3aa17cce-5282-4293-bfe4-1d0a9bbba26b\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "b387cfe84ba48c80b009292201f697eb" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "450ef2bb19756486a3df6a4dc6eb7507" + }, + "m_SlotId": 4 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 4,\n \"m_NodeGUIDSerialized\": \"bf760e52-0ed0-4e3f-9548-543942579ff9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3aa17cce-5282-4293-bfe4-1d0a9bbba26b\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "042d6775af3e4882bfd8f0ce4caa146c" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "4ea0ba4a4540b98986b662b0e34c9d44" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"3aa17cce-5282-4293-bfe4-1d0a9bbba26b\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"d7add9a6-90d6-4bb3-81ab-1d67fb79b97c\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "138397a6db27508ebfa37e627012b311" + }, + "m_SlotId": 2 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "5b7cc1ccc3c2cc8e9b782803430a5ba4" + }, + "m_SlotId": 1 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"40fd538b-0379-4e83-b07f-8ce6dc7258a9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"d7add9a6-90d6-4bb3-81ab-1d67fb79b97c\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "694a11edcfc84825b16012f21ea98bfb" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "5ecedb8c4fe0638ebff5724112c3cda5" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"1907e358-b959-4954-a1db-e2d0c1b1ce01\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"8d64f47c-32e4-4253-a51e-fc07b035423d\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "450ef2bb19756486a3df6a4dc6eb7507" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "5ecedb8c4fe0638ebff5724112c3cda5" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"08206f4f-3fef-4186-80bf-cfab95c6a2cd\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"8d64f47c-32e4-4253-a51e-fc07b035423d\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "a11bb30953bafd8285f837d1caecc92d" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "694a11edcfc84825b16012f21ea98bfb" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"bb63243d-9fcf-4703-b4d2-c364866852cb\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"cf003b92-5eaa-4242-a925-2bd67b183f97\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "f0ce3c0288153f81ba18d523e8384d3a" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "a11bb30953bafd8285f837d1caecc92d" + }, + "m_SlotId": 2 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"cf003b92-5eaa-4242-a925-2bd67b183f97\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"fffca6f9-3461-48b9-98ed-04d768ad5132\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "f0ce3c0288153f81ba18d523e8384d3a" + }, + "m_SlotId": 1 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "b387cfe84ba48c80b009292201f697eb" + }, + "m_SlotId": 4 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"bb63243d-9fcf-4703-b4d2-c364866852cb\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"fffca6f9-3461-48b9-98ed-04d768ad5132\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "2a101c899ff69481b176e85319651599" + }, + "m_SlotId": 0 + } }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "f0ce3c0288153f81ba18d523e8384d3a" + }, + "m_SlotId": 2 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"fffca6f9-3461-48b9-98ed-04d768ad5132\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"40fd538b-0379-4e83-b07f-8ce6dc7258a9\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "9200da3e7096bf8392d845cdedd5c693" + }, + "m_SlotId": 1 + } } ], + "m_VertexContext": { + "m_Position": { + "x": 875.0000610351563, + "y": -69.99999237060547 + }, + "m_Blocks": [] + }, + "m_FragmentContext": { + "m_Position": { + "x": 875.0000610351563, + "y": 130.0 + }, + "m_Blocks": [] + }, "m_PreviewData": { "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", @@ -229,5 +330,1823 @@ }, "m_Path": "Sub Graphs", "m_ConcretePrecision": 0, - "m_ActiveOutputNodeGuidSerialized": "" -} \ No newline at end of file + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "9200da3e7096bf8392d845cdedd5c693" + }, + "m_ActiveTargets": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "042d6775af3e4882bfd8f0ce4caa146c", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 175.0, + "y": 152.99998474121095, + "width": 129.0, + "height": 118.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "719a31e559204e8e9c01ecfcce7937fe" + }, + { + "m_Id": "43866882abd95b8cad2d0848f12d8681" + }, + { + "m_Id": "afe101b8a62c818e8827a8fbf4d85b37" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "106fc8c5eeb6bc89a4babd8f4246d9bc", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "138397a6db27508ebfa37e627012b311", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -349.0, + "y": -99.0, + "width": 208.0, + "height": 433.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "40033d35169d5b8aaf908a2ccf80146b" + }, + { + "m_Id": "de1041dd2f67488097292fb366a963af" + }, + { + "m_Id": "e925bcb7101115838ff6f4ab5b63442d" + }, + { + "m_Id": "c0d5c675c5997f8db3640f137d1733ce" + }, + { + "m_Id": "fe41393a5b3e1d8dafd8cd5318f1a12c" + }, + { + "m_Id": "79e9ea897314c38e8d629acda602431f" + }, + { + "m_Id": "5094fd7797a71e869d417491cb50b4a4" + }, + { + "m_Id": "33814951dae1cf8a90e2939b5b80c3c5" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1ba8b0d99f154988b3d892005263be4f", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2323d2c477750b8ca13dd40a7a4c642c", + "m_Id": 2, + "m_DisplayName": "alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "alpha", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2326ef006e2fed82a2b2aaa603f7c737", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "253666f2e2fab1808ed872dbfb33b5fa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -562.0000610351563, + "y": -58.000003814697269, + "width": 178.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "57dd307a57b1ea80868aebee6c1541ca" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f5798993603c168f9f2f35781e76f32d" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "255c4a685433408fb38fef1dd8bfef64", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "2a101c899ff69481b176e85319651599", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 508.5, + "y": 57.49998092651367, + "width": 125.0, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "346d2bcf6f02a588925c436f79c813af" + }, + { + "m_Id": "106fc8c5eeb6bc89a4babd8f4246d9bc" + }, + { + "m_Id": "89bbc2a7cb18808f8b5575bda9332ee8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2ce8c2baa7ad0085916df960c66d00a9", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.VertexColorNode", + "m_ObjectId": "2fef576ae48fe28095765de08d6a7dd5", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Vertex Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -145.0, + "y": -423.0, + "width": 135.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "a88a5c25a7da5487b7174b837eaea3f3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "30c82a50c8ed6b88b961e7c2cba64560", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "33814951dae1cf8a90e2939b5b80c3c5", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "346d2bcf6f02a588925c436f79c813af", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "35a4b2508fca2f85813dceccd8e52e87", + "m_Id": 1, + "m_DisplayName": "baseColor", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "baseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [ + "X", + "Y", + "Z" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "40033d35169d5b8aaf908a2ccf80146b", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "43866882abd95b8cad2d0848f12d8681", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "450ef2bb19756486a3df6a4dc6eb7507", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -277.00006103515627, + "y": -313.0000305175781, + "width": 120.00000762939453, + "height": 149.00001525878907 + } + }, + "m_Slots": [ + { + "m_Id": "2ce8c2baa7ad0085916df960c66d00a9" + }, + { + "m_Id": "a09189a3b8e6a58c8efba64ffc6c137e" + }, + { + "m_Id": "255c4a685433408fb38fef1dd8bfef64" + }, + { + "m_Id": "30c82a50c8ed6b88b961e7c2cba64560" + }, + { + "m_Id": "d95ad6bc44c96a87a9be6ad5d94a1d39" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4a46ed74bcb842d59fefc120405b6393", + "m_Id": 1, + "m_DisplayName": "On", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "On", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "4ea0ba4a4540b98986b662b0e34c9d44", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -562.0000610351563, + "y": -18.00002670288086, + "width": 91.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "bf006c9b4a5a2687a61b2311c30a5125" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "ce8f6554e8d0508f97307598c2be7200" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "5094fd7797a71e869d417491cb50b4a4", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "5571cbc6f513ee8a879dc7d5f9c10e32", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "57dd307a57b1ea80868aebee6c1541ca", + "m_Id": 0, + "m_DisplayName": "baseColorTexture", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "58554b6d9785ce88a7600b89be231ebf", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": -2.380000114440918, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorspaceConversionNode", + "m_ObjectId": "5b7cc1ccc3c2cc8e9b782803430a5ba4", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Colorspace Conversion", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 14.000005722045899, + "y": -519.0, + "width": 211.00001525878907, + "height": 131.0 + } + }, + "m_Slots": [ + { + "m_Id": "adbe25ef77666f8a890415d2a63164b4" + }, + { + "m_Id": "f96400a86a9c3680b9424a7227a03b5f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 1, + "to": 0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5be9f226f14d8b8eb669fed78cde0b1e", + "m_Id": 0, + "m_DisplayName": "baseColorFactor", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "5ecedb8c4fe0638ebff5724112c3cda5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -557.0, + "y": -122.0, + "width": 163.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "5be9f226f14d8b8eb669fed78cde0b1e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "bbcb866077389285b6753f7439d8cefe" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "694a11edcfc84825b16012f21ea98bfb", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "UNITY_COLORSPACE_GAMMA", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 255.0, + "y": -447.5000305175781, + "width": 222.50001525878907, + "height": 118.0 + } + }, + "m_Slots": [ + { + "m_Id": "f19073c780634a6fbb708914030e7a5d" + }, + { + "m_Id": "4a46ed74bcb842d59fefc120405b6393" + }, + { + "m_Id": "e05358678ec243259580c799d6419066" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "77b0beb4204941d6abdcb8dad422f287" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "719a31e559204e8e9c01ecfcce7937fe", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "752a50581c809483bf44e03aa1dbfa4a", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "77b0beb4204941d6abdcb8dad422f287", + "m_Guid": { + "m_GuidSerialized": "24ecaa53-0f82-42f5-ac46-3c1606553614" + }, + "m_Name": "UNITY_COLORSPACE_GAMMA", + "m_DefaultReferenceName": "BOOLEAN_77B0BEB4204941D6ABDCB8DAD422F287_ON", + "m_OverrideReferenceName": "UNITY_COLORSPACE_GAMMA", + "m_GeneratePropertyBlock": true, + "m_KeywordType": 0, + "m_KeywordDefinition": 2, + "m_KeywordScope": 1, + "m_Entries": [], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "79e9ea897314c38e8d629acda602431f", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_BareResource": false, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "8391514435744c8388dc41e3b7d3c518", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "89bbc2a7cb18808f8b5575bda9332ee8", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", + "m_ObjectId": "9200da3e7096bf8392d845cdedd5c693", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Out_Vector1", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 875.0000610351563, + "y": -69.99999237060547, + "width": 134.0, + "height": 101.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "35a4b2508fca2f85813dceccd8e52e87" + }, + { + "m_Id": "2323d2c477750b8ca13dd40a7a4c642c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "IsFirstSlotValid": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a09189a3b8e6a58c8efba64ffc6c137e", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "a11bb30953bafd8285f837d1caecc92d", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 173.00001525878907, + "y": -160.99998474121095, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "58554b6d9785ce88a7600b89be231ebf" + }, + { + "m_Id": "fe52dcfd706b2284aad6e765af9f9788" + }, + { + "m_Id": "acd8dcb18b5cca8498281ee3bcfb68a8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "a88a5c25a7da5487b7174b837eaea3f3", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "acd8dcb18b5cca8498281ee3bcfb68a8", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "adbe25ef77666f8a890415d2a63164b4", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [ + "X", + "Y", + "Z" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "afe101b8a62c818e8827a8fbf4d85b37", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.GroupData", + "m_ObjectId": "b0da37b8d05f4a1fbd0f231f92cd16c1", + "m_Title": "BaseColor", + "m_Position": { + "x": -374.0000305175781, + "y": -578.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "b387cfe84ba48c80b009292201f697eb", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 254.99996948242188, + "y": -317.0, + "width": 120.99999237060547, + "height": 149.0 + } + }, + "m_Slots": [ + { + "m_Id": "1ba8b0d99f154988b3d892005263be4f" + }, + { + "m_Id": "2326ef006e2fed82a2b2aaa603f7c737" + }, + { + "m_Id": "b9fd3e0ce02b9981a6fb65072d64b1b9" + }, + { + "m_Id": "ca5aad59d86a0a869d06e332eb6f9c6c" + }, + { + "m_Id": "752a50581c809483bf44e03aa1dbfa4a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b9fd3e0ce02b9981a6fb65072d64b1b9", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector4ShaderProperty", + "m_ObjectId": "bbcb866077389285b6753f7439d8cefe", + "m_Guid": { + "m_GuidSerialized": "f5db2ecb-d689-4602-9dd9-c4f655fb7c41" + }, + "m_Name": "baseColorFactor", + "m_DefaultReferenceName": "Vector4_FC55EA20", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "bf006c9b4a5a2687a61b2311c30a5125", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c0d5c675c5997f8db3640f137d1733ce", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ca5aad59d86a0a869d06e332eb6f9c6c", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty", + "m_ObjectId": "ce8f6554e8d0508f97307598c2be7200", + "m_Guid": { + "m_GuidSerialized": "6b928d43-ab83-47b1-a6e7-31c648717852" + }, + "m_Name": "UV", + "m_DefaultReferenceName": "Vector2_8D613221", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d95ad6bc44c96a87a9be6ad5d94a1d39", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "de1041dd2f67488097292fb366a963af", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e05358678ec243259580c799d6419066", + "m_Id": 2, + "m_DisplayName": "Off", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Off", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e925bcb7101115838ff6f4ab5b63442d", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "ef48636203ba2987a6cf53f6902a86fb", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "f0ce3c0288153f81ba18d523e8384d3a", + "m_Group": { + "m_Id": "b0da37b8d05f4a1fbd0f231f92cd16c1" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 508.4999694824219, + "y": -217.0, + "width": 129.0, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "5571cbc6f513ee8a879dc7d5f9c10e32" + }, + { + "m_Id": "8391514435744c8388dc41e3b7d3c518" + }, + { + "m_Id": "ef48636203ba2987a6cf53f6902a86fb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f19073c780634a6fbb708914030e7a5d", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "f5798993603c168f9f2f35781e76f32d", + "m_Guid": { + "m_GuidSerialized": "24774c64-81a9-401f-8e9b-8e59a366a8a4" + }, + "m_Name": "baseColorTexture", + "m_DefaultReferenceName": "Texture2D_FA7B3822", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "f96400a86a9c3680b9424a7227a03b5f", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [ + "X", + "Y", + "Z" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "fe41393a5b3e1d8dafd8cd5318f1a12c", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "fe52dcfd706b2284aad6e765af9f9788", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + diff --git a/Runtime/Shader/SubGraphs/Emission.shadersubgraph b/Runtime/Shader/SubGraphs/Emission.shadersubgraph index 4c20357d..7ccf32cd 100644 --- a/Runtime/Shader/SubGraphs/Emission.shadersubgraph +++ b/Runtime/Shader/SubGraphs/Emission.shadersubgraph @@ -1,5 +1,5 @@ { - "m_SGVersion": 3, + "m_SGVersion": 2, "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "22f4cf26a81a446ab3e256d94a5b8930", "m_Properties": [ @@ -19,12 +19,9 @@ "m_Keywords": [ { "m_Id": "92615af80d5e462e8062954c14a537b4" - } - ], - "m_Dropdowns": [], - "m_CategoryData": [ + }, { - "m_Id": "bb77feeb1e43422db8658300f0760391" + "m_Id": "42d223062ab74032b07b902bf878b515" } ], "m_Nodes": [ @@ -49,9 +46,6 @@ { "m_Id": "3737ffa37379ae87b587a3972b904b05" }, - { - "m_Id": "8d8a50f1b2f0474cbaa582f3f43e2303" - }, { "m_Id": "8b01474d50494dd78b966a01d40b7936" }, @@ -66,6 +60,9 @@ }, { "m_Id": "39c58c66879c4ddfae5d63f413273805" + }, + { + "m_Id": "3c45f52b72e94ab9802a83bbb7097b83" } ], "m_GroupDatas": [ @@ -73,7 +70,11 @@ "m_Id": "46f893b4df34477bad8026a8627a446a" } ], - "m_StickyNoteDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "ff2c0aa82f4f43cf9720b2d2ff83434f" + } + ], "m_Edges": [ { "m_OutputSlot": { @@ -112,9 +113,9 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "8d8a50f1b2f0474cbaa582f3f43e2303" + "m_Id": "3c45f52b72e94ab9802a83bbb7097b83" }, - "m_SlotId": 0 + "m_SlotId": 2 } }, { @@ -126,7 +127,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "8d8a50f1b2f0474cbaa582f3f43e2303" + "m_Id": "3c45f52b72e94ab9802a83bbb7097b83" }, "m_SlotId": 1 } @@ -134,13 +135,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "46a3bee6c6d13c8fb349fc9dec034961" + "m_Id": "3c45f52b72e94ab9802a83bbb7097b83" }, "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "8b01474d50494dd78b966a01d40b7936" + "m_Id": "74d85a63492c1f83955e97c724819404" }, "m_SlotId": 1 } @@ -148,13 +149,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "5dd5d27c6d422d8f943427c716404c74" + "m_Id": "46a3bee6c6d13c8fb349fc9dec034961" }, "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "f9a26538c4fd698b8c7267c61f255b87" + "m_Id": "8b01474d50494dd78b966a01d40b7936" }, "m_SlotId": 1 } @@ -162,13 +163,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "74d85a63492c1f83955e97c724819404" + "m_Id": "5dd5d27c6d422d8f943427c716404c74" }, "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "3737ffa37379ae87b587a3972b904b05" + "m_Id": "f9a26538c4fd698b8c7267c61f255b87" }, "m_SlotId": 1 } @@ -176,15 +177,15 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "8b01474d50494dd78b966a01d40b7936" + "m_Id": "74d85a63492c1f83955e97c724819404" }, - "m_SlotId": 2 + "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "2ca2c9815e8f49edacdb89a52603413e" + "m_Id": "3737ffa37379ae87b587a3972b904b05" }, - "m_SlotId": 0 + "m_SlotId": 1 } }, { @@ -196,7 +197,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "d69565a3d3334fec906d90abed0cf68e" + "m_Id": "2ca2c9815e8f49edacdb89a52603413e" }, "m_SlotId": 0 } @@ -204,15 +205,15 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "8d8a50f1b2f0474cbaa582f3f43e2303" + "m_Id": "8b01474d50494dd78b966a01d40b7936" }, "m_SlotId": 2 }, "m_InputSlot": { "m_Node": { - "m_Id": "74d85a63492c1f83955e97c724819404" + "m_Id": "d69565a3d3334fec906d90abed0cf68e" }, - "m_SlotId": 1 + "m_SlotId": 0 } }, { @@ -276,11 +277,10 @@ "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", "m_Guid": "" - }, - "preventRotation": false + } }, "m_Path": "Sub Graphs", - "m_GraphPrecision": 0, + "m_ConcretePrecision": 0, "m_PreviewMode": 2, "m_OutputNode": { "m_Id": "3737ffa37379ae87b587a3972b904b05" @@ -416,7 +416,7 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -311.5, + "x": -313.00006103515627, "y": -414.0, "width": 211.5, "height": 130.5 @@ -455,8 +455,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -772.9999389648438, - "y": -348.0000305175781, + "x": -774.5, + "y": -347.9999694824219, "width": 92.5, "height": 34.0 } @@ -509,13 +509,9 @@ "m_GuidSerialized": "92c6bdd4-ca31-4b5a-bc1c-6794cd65d522" }, "m_Name": "emissiveTexture", - "m_DefaultRefNameVersion": 0, - "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Texture2D_8C55BE6", "m_OverrideReferenceName": "", "m_GeneratePropertyBlock": true, - "m_UseCustomSlotLabel": false, - "m_CustomSlotLabel": "", "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -524,8 +520,6 @@ "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", "m_Guid": "" }, - "isMainTexture": false, - "useTilingAndOffset": false, "m_Modifiable": true, "m_DefaultType": 0 } @@ -606,8 +600,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 416.0, - "y": -417.0, + "x": 389.5, + "y": -265.4999694824219, "width": 211.5, "height": 130.5 } @@ -668,8 +662,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1396.0, - "y": -283.5, + "x": 1394.5, + "y": -283.4999694824219, "width": 116.49999237060547, "height": 77.0 } @@ -701,10 +695,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 385.4999694824219, - "y": -206.49996948242188, - "width": 366.4999694824219, - "height": 141.99998474121095 + "x": 389.5, + "y": -499.9999694824219, + "width": 363.5, + "height": 117.99999237060547 } }, "m_Slots": [ @@ -734,6 +728,66 @@ "m_FunctionBody": "Enter function body here..." } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "3c45f52b72e94ab9802a83bbb7097b83", + "m_Group": { + "m_Id": "46f893b4df34477bad8026a8627a446a" + }, + "m_Name": "UNITY_HEADER_HD_INCLUDED", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 780.5, + "y": -286.5, + "width": 226.5, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "b55475a80b2945fd88d08be3d30f4283" + }, + { + "m_Id": "9b2098765fe4419196a15f34d7e3fea1" + }, + { + "m_Id": "4ee3f18247d5406cb171dbb854791272" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "42d223062ab74032b07b902bf878b515" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "42d223062ab74032b07b902bf878b515", + "m_Guid": { + "m_GuidSerialized": "6a477e46-19fc-42d2-ad3c-2f93d0264344" + }, + "m_Name": "UNITY_HEADER_HD_INCLUDED", + "m_DefaultReferenceName": "BOOLEAN_42D223062AB74032B07B902BF878B515_ON", + "m_OverrideReferenceName": "UNITY_HEADER_HD_INCLUDED", + "m_GeneratePropertyBlock": true, + "m_KeywordType": 0, + "m_KeywordDefinition": 2, + "m_KeywordScope": 1, + "m_Entries": [], + "m_Value": 0, + "m_IsEditable": true +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -746,8 +800,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -774.9999389648438, - "y": -105.00006866455078, + "x": -776.5, + "y": -104.99995422363281, "width": 156.5, "height": 34.0 } @@ -775,8 +829,8 @@ "m_ObjectId": "46f893b4df34477bad8026a8627a446a", "m_Title": "Emission", "m_Position": { - "x": -800.0000610351563, - "y": -475.5 + "x": -801.4999389648438, + "y": -645.5 } } @@ -803,6 +857,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4ee3f18247d5406cb171dbb854791272", + "m_Id": 2, + "m_DisplayName": "Off", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Off", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", @@ -855,8 +933,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -774.9999389648438, - "y": -382.0000305175781, + "x": -776.5, + "y": -382.0, "width": 169.5, "height": 34.0 } @@ -954,29 +1032,6 @@ "m_Channel": 0 } -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", - "m_ObjectId": "72c0866940bd48b2b954ea505f2bca81", - "m_Id": 1, - "m_DisplayName": "HighDefinition", - "m_SlotType": 0, - "m_Hidden": false, - "m_ShaderOutputName": "HighDefinition", - "m_StageCapability": 3, - "m_Value": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_Labels": [] -} - { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.KeywordNode", @@ -989,8 +1044,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 1191.0, - "y": -285.0, + "x": 1189.5, + "y": -284.9999694824219, "width": 138.0, "height": 117.99999237060547 } @@ -1049,13 +1104,9 @@ "m_GuidSerialized": "4a9d9167-db8f-4234-b477-bd2175918ed0" }, "m_Name": "UV", - "m_DefaultRefNameVersion": 0, - "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector2_2269B91D", "m_OverrideReferenceName": "", "m_GeneratePropertyBlock": true, - "m_UseCustomSlotLabel": false, - "m_CustomSlotLabel": "", "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -1104,10 +1155,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -51.50000762939453, - "y": -265.5, - "width": 129.5000762939453, - "height": 117.99998474121094 + "x": -53.00000762939453, + "y": -265.4999694824219, + "width": 129.0, + "height": 117.99999237060547 } }, "m_Slots": [ @@ -1130,48 +1181,6 @@ } } -{ - "m_SGVersion": 1, - "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", - "m_ObjectId": "8d8a50f1b2f0474cbaa582f3f43e2303", - "m_Group": { - "m_Id": "46f893b4df34477bad8026a8627a446a" - }, - "m_Name": "RPSwitch (Custom Function)", - "m_DrawState": { - "m_Expanded": true, - "m_Position": { - "serializedVersion": "2", - "x": 798.0, - "y": -285.0, - "width": 208.0, - "height": 302.0 - } - }, - "m_Slots": [ - { - "m_Id": "fa9ac0835f144585866ed5ea60d4f805" - }, - { - "m_Id": "72c0866940bd48b2b954ea505f2bca81" - }, - { - "m_Id": "bc08c5075a804f1e962031791a137abf" - } - ], - "synonyms": [], - "m_Precision": 0, - "m_PreviewExpanded": true, - "m_PreviewMode": 0, - "m_CustomColors": { - "m_SerializableColors": [] - }, - "m_SourceType": 1, - "m_FunctionName": "RPSwitch", - "m_FunctionSource": "", - "m_FunctionBody": "#if defined(UNITY_HEADER_HD_INCLUDED)\nOut = HighDefinition;\n#else\nOut = Default;\n#endif" -} - { "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", @@ -1180,22 +1189,41 @@ "m_GuidSerialized": "94352154-e4c5-42ab-9109-5ba44b6e670f" }, "m_Name": "EMISSIVE", - "m_DefaultRefNameVersion": 0, - "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "", "m_OverrideReferenceName": "_EMISSIVE", "m_GeneratePropertyBlock": false, - "m_UseCustomSlotLabel": false, - "m_CustomSlotLabel": "", "m_KeywordType": 0, "m_KeywordDefinition": 0, "m_KeywordScope": 0, - "m_KeywordStages": 63, "m_Entries": [], "m_Value": 0, "m_IsEditable": true } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "9b2098765fe4419196a15f34d7e3fea1", + "m_Id": 1, + "m_DisplayName": "On", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "On", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", @@ -1219,6 +1247,30 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b55475a80b2945fd88d08be3d30f4283", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.CategoryData", @@ -1243,29 +1295,6 @@ ] } -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", - "m_ObjectId": "bc08c5075a804f1e962031791a137abf", - "m_Id": 2, - "m_DisplayName": "Out", - "m_SlotType": 1, - "m_Hidden": false, - "m_ShaderOutputName": "Out", - "m_StageCapability": 3, - "m_Value": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_Labels": [] -} - { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -1278,8 +1307,8 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -774.9999389648438, - "y": 23.999963760375978, + "x": -776.5, + "y": -455.9999694824219, "width": 160.5, "height": 34.0 } @@ -1437,9 +1466,9 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 150.00001525878907, - "y": -206.4999542236328, - "width": 211.50001525878907, + "x": 129.99998474121095, + "y": -586.5, + "width": 211.5, "height": 130.5 } }, @@ -1485,13 +1514,9 @@ "m_GuidSerialized": "c75fdb25-0e31-46d0-b09b-f0f3505da651" }, "m_Name": "emissiveFactor", - "m_DefaultRefNameVersion": 0, - "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector3_BDA4AC8B", "m_OverrideReferenceName": "", "m_GeneratePropertyBlock": true, - "m_UseCustomSlotLabel": false, - "m_CustomSlotLabel": "", "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -1512,13 +1537,9 @@ "m_GuidSerialized": "10cf4f3e-02c3-47e9-a182-4c8c9de5deb4" }, "m_Name": "exposureWeight", - "m_DefaultRefNameVersion": 0, - "m_RefNameGeneratedByDisplayName": "", "m_DefaultReferenceName": "Vector1_AC5B6513", "m_OverrideReferenceName": "", "m_GeneratePropertyBlock": true, - "m_UseCustomSlotLabel": false, - "m_CustomSlotLabel": "", "m_Precision": 0, "overrideHLSLDeclaration": false, "hlslDeclarationOverride": 0, @@ -1543,7 +1564,7 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -517.4999389648438, + "x": -519.0, "y": -414.0, "width": 183.0, "height": 250.0 @@ -1583,31 +1604,7 @@ "m_SerializableColors": [] }, "m_TextureType": 0, - "m_NormalMapSpace": 0, - "m_EnableGlobalMipBias": true -} - -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", - "m_ObjectId": "fa9ac0835f144585866ed5ea60d4f805", - "m_Id": 0, - "m_DisplayName": "Default", - "m_SlotType": 0, - "m_Hidden": false, - "m_ShaderOutputName": "Default", - "m_StageCapability": 3, - "m_Value": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "m_Labels": [] + "m_NormalMapSpace": 0 } { @@ -1710,3 +1707,23 @@ "m_DefaultType": 0 } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "ff2c0aa82f4f43cf9720b2d2ff83434f", + "m_Title": "HDRP detection", + "m_Content": "UNITY_HEADER_HD_INCLUDED is set when High Definition Render Pipeline is in use.\nNOTE: Does not work in Shader Graph Preview", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": 785.0, + "y": -385.0, + "width": 201.5, + "height": 100.0 + }, + "m_Group": { + "m_Id": "46f893b4df34477bad8026a8627a446a" + } +} + From c15564643c7f677900c7435c622f65f611def7c7 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Thu, 11 Apr 2024 16:07:45 +0200 Subject: [PATCH 05/10] fix: On Apple visionOS, textures are always created readable, so that PolySpatial is able to convert them. (#121) --- CHANGELOG.md | 1 + Runtime/Scripts/GltfImport.cs | 44 +++++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 074479b2..79a594f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Shader sub graphs *BaseColor* and *Emission* are now compatible with [PolySpatial visionOS][PolySpatialVisionOS]. +- On Apple visionOS, textures are always created readable, so that [PolySpatial visionOS][PolySpatialVisionOS] is able to convert them. ## [6.3.0] - 2024-03-27 diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index 09f123bf..b90ea73c 100644 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -231,7 +231,9 @@ public abstract class GltfImportBase : IGltfReadable, IGltfBuffers, IDisposable HashSet m_NonFlippedYTextureIndices; #endif ImageFormat[] m_ImageFormats; +#if !UNITY_VISIONOS bool[] m_ImageReadable; +#endif bool[] m_ImageGamma; /// optional glTF-binary buffer @@ -1255,11 +1257,13 @@ void SetImageGamma(TextureInfoBase txtInfo) imageVariants[imageIndex].Add(txt.sampler); } +#if !UNITY_VISIONOS m_ImageReadable = new bool[m_Images.Length]; for (int i = 0; i < m_Images.Length; i++) { m_ImageReadable[i] = imageVariants[i] != null && imageVariants[i].Count > 1; } +#endif Profiler.EndSample(); List imageTasks = null; @@ -1303,7 +1307,16 @@ void SetImageGamma(TextureInfoBase txtInfo) // Not Inside buffer if (!string.IsNullOrEmpty(img.uri)) { - LoadImage(imageIndex, UriHelper.GetUriString(img.uri, baseUri), !m_ImageReadable[imageIndex], imgFormat == ImageFormat.Ktx); + LoadImage( + imageIndex, + UriHelper.GetUriString(img.uri, baseUri), +#if UNITY_VISIONOS + false, +#else + !m_ImageReadable[imageIndex], +#endif + imgFormat == ImageFormat.Ktx + ); } else { @@ -1351,7 +1364,14 @@ void SetImageGamma(TextureInfoBase txtInfo) // TODO: Investigate alternative: native texture creation in worker thread bool forceSampleLinear = m_ImageGamma != null && !m_ImageGamma[imageIndex]; var txt = CreateEmptyTexture(img, imageIndex, forceSampleLinear); - txt.LoadImage(data,!m_ImageReadable[imageIndex]); + txt.LoadImage( + data, +#if UNITY_VISIONOS + false +#else + !m_ImageReadable[imageIndex] +#endif + ); m_Images[imageIndex] = txt; Profiler.EndSample(); } @@ -1425,7 +1445,14 @@ async Task WaitForTextureDownloads() var forceSampleLinear = m_ImageGamma!=null && !m_ImageGamma[imageIndex]; txt = CreateEmptyTexture(Root.Images[imageIndex], imageIndex, forceSampleLinear); // TODO: Investigate for NativeArray variant to avoid `www.data` - txt.LoadImage(www.Data,!m_ImageReadable[imageIndex]); + txt.LoadImage( + www.Data, +#if UNITY_VISIONOS + false +#else + !m_ImageReadable[imageIndex] +#endif + ); #else m_Logger?.Warning(LogCode.ImageConversionNotEnabled); txt = null; @@ -1905,7 +1932,14 @@ async Task Prepare() { jh.jobHandle.Complete(); #if UNITY_IMAGECONVERSION - m_Images[jh.imageIndex].LoadImage(jh.buffer,!m_ImageReadable[jh.imageIndex]); + m_Images[jh.imageIndex].LoadImage( + jh.buffer, +#if UNITY_VISIONOS + false +#else + !m_ImageReadable[jh.imageIndex] +#endif + ); #endif jh.gcHandle.Free(); m_ImageCreateContexts.RemoveAt(i); @@ -2347,7 +2381,9 @@ void DisposeVolatileData() m_ImageCreateContexts = null; m_Images = null; m_ImageFormats = null; +#if !UNITY_VISIONOS m_ImageReadable = null; +#endif m_ImageGamma = null; m_GlbBinChunk = null; m_MaterialPointsSupport = null; From 114123747565ac99fffb3a93668c9ff3b25f35ea Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Mon, 15 Apr 2024 16:04:52 +0200 Subject: [PATCH 06/10] fix: Draco compressed tangents import tangents correctly now. (#122) --- CHANGELOG.md | 1 + Runtime/Scripts/PrimitiveDracoCreateContext.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79a594f4..b7eb4175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Shader sub graphs *BaseColor* and *Emission* are now compatible with [PolySpatial visionOS][PolySpatialVisionOS]. - On Apple visionOS, textures are always created readable, so that [PolySpatial visionOS][PolySpatialVisionOS] is able to convert them. +- Draco compressed tangents import tangents correctly now. ## [6.3.0] - 2024-03-27 diff --git a/Runtime/Scripts/PrimitiveDracoCreateContext.cs b/Runtime/Scripts/PrimitiveDracoCreateContext.cs index 98850826..96eecd06 100644 --- a/Runtime/Scripts/PrimitiveDracoCreateContext.cs +++ b/Runtime/Scripts/PrimitiveDracoCreateContext.cs @@ -120,7 +120,7 @@ public void StartDecode(NativeSlice data, Attributes dracoAttributes) if (attributes.NORMAL >= 0) result[VertexAttribute.Normal] = attributes.NORMAL; if (attributes.TANGENT >= 0) - result[VertexAttribute.Normal] = attributes.TANGENT; + result[VertexAttribute.Tangent] = attributes.TANGENT; if (attributes.COLOR_0 >= 0) result[VertexAttribute.Color] = attributes.COLOR_0; if (attributes.TEXCOORD_0 >= 0) From 6f4d088ade1d979162810c2eecfb494cab6ba3a0 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Mon, 15 Apr 2024 22:08:49 +0200 Subject: [PATCH 07/10] fix: Detect use of HDRP via `SHADEROPTIONS_PRE_EXPOSITION` HLSL define (instead of `UNITY_HEADER_HD_INCLUDED`, which only worked in 2020 LTS). (#123) --- CHANGELOG.md | 2 +- .../Shader/SubGraphs/Emission.shadersubgraph | 61 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7eb4175..1501cac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed -- *Emission* sub graph uses shader define [`UNITY_HEADER_HD_INCLUDED`](https://forum.unity.com/threads/deploying-for-multiple-rp.1342277/) for HDRP usage detection (replacing a custom function node). +- *Emission* sub graph uses shader define `SHADEROPTIONS_PRE_EXPOSITION` for HDRP usage detection (replacing a custom function node that checked for `UNITY_HEADER_HD_INCLUDED`). - *BaseColor* sub graph uses built-in shader define [`UNITY_COLORSPACE_GAMMA`](https://docs.unity3d.com/ScriptReference/Rendering.BuiltinShaderDefine.UNITY_COLORSPACE_GAMMA.html) for project color space detection (replacing a custom function node). ### Fixed diff --git a/Runtime/Shader/SubGraphs/Emission.shadersubgraph b/Runtime/Shader/SubGraphs/Emission.shadersubgraph index 7ccf32cd..bcf3ae69 100644 --- a/Runtime/Shader/SubGraphs/Emission.shadersubgraph +++ b/Runtime/Shader/SubGraphs/Emission.shadersubgraph @@ -735,7 +735,7 @@ "m_Group": { "m_Id": "46f893b4df34477bad8026a8627a446a" }, - "m_Name": "UNITY_HEADER_HD_INCLUDED", + "m_Name": "SHADEROPTIONS_PRE_EXPOSITION", "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -770,15 +770,15 @@ } { - "m_SGVersion": 0, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", "m_ObjectId": "42d223062ab74032b07b902bf878b515", "m_Guid": { "m_GuidSerialized": "6a477e46-19fc-42d2-ad3c-2f93d0264344" }, - "m_Name": "UNITY_HEADER_HD_INCLUDED", + "m_Name": "SHADEROPTIONS_PRE_EXPOSITION", "m_DefaultReferenceName": "BOOLEAN_42D223062AB74032B07B902BF878B515_ON", - "m_OverrideReferenceName": "UNITY_HEADER_HD_INCLUDED", + "m_OverrideReferenceName": "SHADEROPTIONS_PRE_EXPOSITION", "m_GeneratePropertyBlock": true, "m_KeywordType": 0, "m_KeywordDefinition": 2, @@ -1247,6 +1247,33 @@ "m_Labels": [] } +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "a026c30c138547f9830d56ef20a3248f", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "e8c2953e3a3a1d88bec823091a269ccc" + }, + { + "m_Id": "2413f29fc4bfc28ab3f24ea650d93042" + }, + { + "m_Id": "84cd41d18a890081a8905c3217f9fdce" + }, + { + "m_Id": "ebe21fbba1783e84a0d5dbfaa05bf5ab" + }, + { + "m_Id": "92615af80d5e462e8062954c14a537b4" + }, + { + "m_Id": "42d223062ab74032b07b902bf878b515" + } + ] +} + { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -1271,30 +1298,6 @@ } } -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.CategoryData", - "m_ObjectId": "bb77feeb1e43422db8658300f0760391", - "m_Name": "", - "m_ChildObjectList": [ - { - "m_Id": "e8c2953e3a3a1d88bec823091a269ccc" - }, - { - "m_Id": "2413f29fc4bfc28ab3f24ea650d93042" - }, - { - "m_Id": "84cd41d18a890081a8905c3217f9fdce" - }, - { - "m_Id": "ebe21fbba1783e84a0d5dbfaa05bf5ab" - }, - { - "m_Id": "92615af80d5e462e8062954c14a537b4" - } - ] -} - { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -1712,7 +1715,7 @@ "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", "m_ObjectId": "ff2c0aa82f4f43cf9720b2d2ff83434f", "m_Title": "HDRP detection", - "m_Content": "UNITY_HEADER_HD_INCLUDED is set when High Definition Render Pipeline is in use.\nNOTE: Does not work in Shader Graph Preview", + "m_Content": "SHADEROPTIONS_PRE_EXPOSITION is set when High Definition Render Pipeline is in use.\nNOTE: Does not work in Shader Graph Preview", "m_TextSize": 0, "m_Theme": 0, "m_Position": { From e29b6c6748510e29a7ebee0b987039aac77c1fde Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Tue, 16 Apr 2024 15:35:15 +0200 Subject: [PATCH 08/10] feat: Import load and Burst job tests (#125) * feat: Burst jobs tests. * refactor: Renamed LoadTests to AssetTests. * feat: Tests for all `GltfImport.Load` overloads. --- CHANGELOG.md | 4 + Tests/Editor/GltfImporterTest.cs | 2 +- Tests/Runtime/Scripts/Constants.cs | 15 + Tests/Runtime/Scripts/Constants.cs.meta | 11 + Tests/Runtime/Scripts/Import/AssetsTests.cs | 87 + .../Scripts/Import/AssetsTests.cs.meta | 11 + .../Scripts/Import/GltfTestCaseAttribute.cs | 22 +- .../Scripts/Import/GltfTestCaseFilter.cs | 23 + .../Scripts/Import/GltfTestCaseFilter.cs.meta | 3 + .../Runtime/Scripts/Import/GltfTestCaseSet.cs | 20 +- Tests/Runtime/Scripts/Import/LoadTests.cs | 210 ++- .../Runtime/Scripts/Import/LoadTests.cs.meta | 2 +- Tests/Runtime/Scripts/JobTests.cs | 1531 +++++++++++++++++ Tests/Runtime/Scripts/JobTests.cs.meta | 11 + Tests/Runtime/Scripts/Utils.cs | 112 ++ Tests/Runtime/Scripts/Utils.cs.meta | 11 + Tests/Runtime/Scripts/glTFast.Tests.asmdef | 1 + 17 files changed, 2010 insertions(+), 66 deletions(-) create mode 100644 Tests/Runtime/Scripts/Constants.cs create mode 100644 Tests/Runtime/Scripts/Constants.cs.meta create mode 100644 Tests/Runtime/Scripts/Import/AssetsTests.cs create mode 100644 Tests/Runtime/Scripts/Import/AssetsTests.cs.meta create mode 100644 Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs create mode 100644 Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs.meta create mode 100644 Tests/Runtime/Scripts/JobTests.cs create mode 100644 Tests/Runtime/Scripts/JobTests.cs.meta create mode 100644 Tests/Runtime/Scripts/Utils.cs create mode 100644 Tests/Runtime/Scripts/Utils.cs.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index 1501cac0..0d2245cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Tests for all `GltfImport.Load` overloads. +- Tests for all import Burst jobs. + ### Changed - *Emission* sub graph uses shader define `SHADEROPTIONS_PRE_EXPOSITION` for HDRP usage detection (replacing a custom function node that checked for `UNITY_HEADER_HD_INCLUDED`). - *BaseColor* sub graph uses built-in shader define [`UNITY_COLORSPACE_GAMMA`](https://docs.unity3d.com/ScriptReference/Rendering.BuiltinShaderDefine.UNITY_COLORSPACE_GAMMA.html) for project color space detection (replacing a custom function node). diff --git a/Tests/Editor/GltfImporterTest.cs b/Tests/Editor/GltfImporterTest.cs index 475d0faa..bf3dc82b 100644 --- a/Tests/Editor/GltfImporterTest.cs +++ b/Tests/Editor/GltfImporterTest.cs @@ -64,7 +64,7 @@ public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase test var importer = (GltfImporter)AssetImporter.GetAtPath(assetPath); Assert.NotNull(importer, $"No glTF importer at {assetPath}"); - LoadTests.AssertLogItems(importer.reportItems, testCase); + AssetsTests.AssertLogItems(importer.reportItems, testCase); #endif yield return null; } diff --git a/Tests/Runtime/Scripts/Constants.cs b/Tests/Runtime/Scripts/Constants.cs new file mode 100644 index 00000000..b9692640 --- /dev/null +++ b/Tests/Runtime/Scripts/Constants.cs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System; + +namespace GLTFast.Tests +{ + static class Constants + { + public const float epsilonUInt8 = .004f; + public const float epsilonInt8 = .008f; + public const float epsilonUInt16 = .000016f; + public const float epsilonInt16 = .000031f; + } +} diff --git a/Tests/Runtime/Scripts/Constants.cs.meta b/Tests/Runtime/Scripts/Constants.cs.meta new file mode 100644 index 00000000..ec677271 --- /dev/null +++ b/Tests/Runtime/Scripts/Constants.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 010a75c3d12e4521a8f278cd3264abaf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Import/AssetsTests.cs b/Tests/Runtime/Scripts/Import/AssetsTests.cs new file mode 100644 index 00000000..af0e5bee --- /dev/null +++ b/Tests/Runtime/Scripts/Import/AssetsTests.cs @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using GLTFast.Logging; +using NUnit.Framework; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace GLTFast.Tests.Import +{ + [TestFixture] + class AssetsTests + { + [GltfTestCase("glTF-test-models", 22)] + public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var loadLogger = new CollectingLogger(); + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + Debug.Log($"Loading {testCase} from {path}"); + + using (var gltf = new GltfImport(deferAgent: deferAgent, logger: loadLogger)) + { + var task = gltf.Load(path); + yield return AsyncWrapper.WaitForTask(task); + var success = task.Result; + if (success ^ !testCase.expectLoadFail) + { + AssertLoggers(new[] { loadLogger }, testCase); + if (success) + { + throw new AssertionException("glTF import unexpectedly succeeded!"); + } + + throw new AssertionException("glTF import failed!"); + } + + if (!success) + { + AssertLoggers(new[] { loadLogger }, testCase); + yield break; + } + var instantiateLogger = new CollectingLogger(); + var instantiator = new GameObjectInstantiator(gltf, go.transform, instantiateLogger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return AsyncWrapper.WaitForTask(task); + success = task.Result; + if (!success) + { + instantiateLogger.LogAll(); + throw new AssertionException("glTF instantiation failed"); + } + Object.Destroy(go); + AssertLoggers(new[] { loadLogger, instantiateLogger }, testCase); + } + } + + static void AssertLoggers(IEnumerable loggers, GltfTestCase testCase) + { + AssertLogItems(IterateLoggerItems(), testCase); + return; + + IEnumerable IterateLoggerItems() + { + foreach (var logger in loggers) + { + if (logger.Count < 1) continue; + foreach (var item in logger.Items) + { + yield return item; + } + } + } + } + + internal static void AssertLogItems(IEnumerable logItems, GltfTestCase testCase) + { + LoggerTest.AssertLogCodes(logItems, testCase.expectedLogCodes); + } + } +} diff --git a/Tests/Runtime/Scripts/Import/AssetsTests.cs.meta b/Tests/Runtime/Scripts/Import/AssetsTests.cs.meta new file mode 100644 index 00000000..31fde93a --- /dev/null +++ b/Tests/Runtime/Scripts/Import/AssetsTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81161889e3c754c72aa340372bca135b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs b/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs index ece1cf7b..56ffd215 100644 --- a/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs +++ b/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.RegularExpressions; using NUnit.Framework; using NUnit.Framework.Interfaces; using NUnit.Framework.Internal; @@ -18,14 +19,14 @@ namespace GLTFast.Tests.Import class GltfTestCaseAttribute : UnityEngine.TestTools.UnityTestAttribute, ITestBuilder { readonly GltfTestCaseSet m_TestCases; + readonly GltfTestCaseFilter m_Filter; readonly NUnitTestCaseBuilder m_Builder = new NUnitTestCaseBuilder(); - public GltfTestCaseAttribute(string testSetName, int testCaseCount) + public GltfTestCaseAttribute(string testSetName, int testCaseCount, string includeFilter = null) { - string path = null; #if UNITY_EDITOR - path = $"Packages/{GltfGlobals.GltfPackageName}/Tests/Runtime/TestCaseSets/{testSetName}.asset"; + var path = $"Packages/{GltfGlobals.GltfPackageName}/Tests/Runtime/TestCaseSets/{testSetName}.asset"; m_TestCases = AssetDatabase.LoadAssetAtPath(path); if (m_TestCases == null) { @@ -33,16 +34,23 @@ public GltfTestCaseAttribute(string testSetName, int testCaseCount) m_TestCases = AssetDatabase.LoadAssetAtPath(path); } #else - path = $"{testSetName}.json"; + var path = $"{testSetName}.json"; m_TestCases = GltfTestCaseSet.DeserializeFromStreamingAssets(path); #endif if (m_TestCases == null) { throw new InvalidDataException($"Test case collection not found at {path}"); } - if (testCaseCount != m_TestCases.TestCaseCount) + + m_Filter = includeFilter == null ? null : new GltfTestCaseFilter(new Regex(includeFilter)); + var actualTestCaseCount = m_TestCases.GetTestCaseCount(m_Filter); + if (testCaseCount != actualTestCaseCount) { - throw new InvalidDataException($"Incorrect number of test cases in {testSetName}. Expected {testCaseCount}, but found {m_TestCases.TestCaseCount}"); + throw new InvalidDataException( + $"Incorrect number of test cases in {testSetName}. " + + $"Expected {testCaseCount}, but found {actualTestCaseCount} " + + (includeFilter == null ? "" : $"(includeFilter: \"{includeFilter}\")") + ); } } @@ -53,7 +61,7 @@ IEnumerable ITestBuilder.BuildFrom(IMethodInfo method, Test suite) try { - foreach (var testCase in m_TestCases.IterateTestCases()) + foreach (var testCase in m_TestCases.IterateTestCases(m_Filter)) { var data = new TestCaseData(new object[] { m_TestCases, testCase }); diff --git a/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs b/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs new file mode 100644 index 00000000..88ca80c9 --- /dev/null +++ b/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the Draco for Unity authors +// SPDX-License-Identifier: Apache-2.0 + +using System; +using System.Text.RegularExpressions; + +namespace GLTFast.Tests.Import +{ + class GltfTestCaseFilter + { + Regex m_IncludeFilter; + + public GltfTestCaseFilter(Regex includeFilter) + { + m_IncludeFilter = includeFilter; + } + + public bool Matches(GltfTestCase testCase) + { + return m_IncludeFilter.IsMatch(testCase.relativeUri); + } + } +} diff --git a/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs.meta b/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs.meta new file mode 100644 index 00000000..d17dcf8c --- /dev/null +++ b/Tests/Runtime/Scripts/Import/GltfTestCaseFilter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6a55c08a433740e7aea3f11aa63a5ce3 +timeCreated: 1713258913 \ No newline at end of file diff --git a/Tests/Runtime/Scripts/Import/GltfTestCaseSet.cs b/Tests/Runtime/Scripts/Import/GltfTestCaseSet.cs index e0e3dc65..e0ac7b21 100644 --- a/Tests/Runtime/Scripts/Import/GltfTestCaseSet.cs +++ b/Tests/Runtime/Scripts/Import/GltfTestCaseSet.cs @@ -48,12 +48,28 @@ class GltfTestCaseSet : ScriptableObject public string streamingAssetsPath => $"gltfast/{assetsRelativePath}"; - public IEnumerable IterateTestCases() + public IEnumerable IterateTestCases(GltfTestCaseFilter filter = null) { foreach (var testCase in m_TestCases) { - yield return testCase; + if (filter == null || filter.Matches(testCase)) + { + yield return testCase; + } + } + } + + public uint GetTestCaseCount(GltfTestCaseFilter filter = null) + { + var count = 0u; + foreach (var testCase in m_TestCases) + { + if (filter == null || filter.Matches(testCase)) + { + count++; + } } + return count; } public static GltfTestCaseSet DeserializeFromStreamingAssets(string path) diff --git a/Tests/Runtime/Scripts/Import/LoadTests.cs b/Tests/Runtime/Scripts/Import/LoadTests.cs index 2f857c13..971d0d4a 100644 --- a/Tests/Runtime/Scripts/Import/LoadTests.cs +++ b/Tests/Runtime/Scripts/Import/LoadTests.cs @@ -1,87 +1,187 @@ -// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using System; using System.Collections; -using System.Collections.Generic; using System.IO; -using System.Linq; -using GLTFast.Logging; using NUnit.Framework; using UnityEngine; using Object = UnityEngine.Object; +using GLTFast.Logging; namespace GLTFast.Tests.Import { - [TestFixture] + /// + /// Tests all of 's load methods. + /// + [Category("Import")] class LoadTests { - [GltfTestCase("glTF-test-models", 22)] - public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + const string k_RelativeUriFilter = @"\/RelativeUri\.gl(b|tf)$"; + + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadString(GltfTestCaseSet testCaseSet, GltfTestCase testCase) { var go = new GameObject(); var deferAgent = new UninterruptedDeferAgent(); - var loadLogger = new CollectingLogger(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); - Debug.Log($"Loading {testCase} from {path}"); + var task = gltf.Load(path); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + Object.Destroy(go); + } - using (var gltf = new GltfImport(deferAgent: deferAgent, logger: loadLogger)) - { - var task = gltf.Load(path); - yield return AsyncWrapper.WaitForTask(task); - var success = task.Result; - if (success ^ !testCase.expectLoadFail) - { - AssertLoggers(new[] { loadLogger }, testCase); - if (success) - { - throw new AssertionException("glTF import unexpectedly succeeded!"); - } + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadUri(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + var uri = new Uri(path, UriKind.RelativeOrAbsolute); + var task = gltf.Load(uri); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); - throw new AssertionException("glTF import failed!"); - } + task = gltf.InstantiateMainSceneAsync(go.transform); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); - if (!success) - { - AssertLoggers(new[] { loadLogger }, testCase); - yield break; - } - var instantiateLogger = new CollectingLogger(); - var instantiator = new GameObjectInstantiator(gltf, go.transform, instantiateLogger); - task = gltf.InstantiateMainSceneAsync(instantiator); - yield return AsyncWrapper.WaitForTask(task); - success = task.Result; - if (!success) - { - instantiateLogger.LogAll(); - throw new AssertionException("glTF instantiation failed"); - } - Object.Destroy(go); - AssertLoggers(new[] { loadLogger, instantiateLogger }, testCase); - } + var firstSceneGameObject = new GameObject("firstScene"); + task = gltf.InstantiateSceneAsync(firstSceneGameObject.transform); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + + Object.Destroy(go); + } + + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator Load(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + Debug.Log($"Testing {path}"); + var data = File.ReadAllBytes(path); + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var task = gltf.Load(data, new Uri(path)); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + Object.Destroy(go); + } + + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadSyncInstantiation(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + Debug.Log($"Testing {path}"); + var data = File.ReadAllBytes(path); + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var task = gltf.Load(data, new Uri(path)); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); +#pragma warning disable CS0618 + success = gltf.InstantiateMainScene(instantiator); +#pragma warning restore CS0618 + Assert.IsTrue(success); + Object.Destroy(go); } - static void AssertLoggers(IEnumerable loggers, GltfTestCase testCase) + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadFile(GltfTestCaseSet testCaseSet, GltfTestCase testCase) { - AssertLogItems(IterateLoggerItems(), testCase); - return; + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + Debug.Log($"Testing {path}"); + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var task = gltf.LoadFile(path, new Uri(path)); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + Object.Destroy(go); + } - IEnumerable IterateLoggerItems() + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadBinary(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + if (!path.EndsWith(".glb")) { - foreach (var logger in loggers) - { - if (logger.Count < 1) continue; - foreach (var item in logger.Items) - { - yield return item; - } - } + Assert.Ignore("Wrong glTF type. Skipping"); } + Debug.Log($"Testing {path}"); + var data = File.ReadAllBytes(path); + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var task = gltf.LoadGltfBinary(data, new Uri(path)); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + Object.Destroy(go); } - internal static void AssertLogItems(IEnumerable logItems, GltfTestCase testCase) + [GltfTestCase("glTF-test-models", 2, k_RelativeUriFilter)] + public IEnumerator LoadJson(GltfTestCaseSet testCaseSet, GltfTestCase testCase) { - LoggerTest.AssertLogCodes(logItems, testCase.expectedLogCodes); + var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); + if (!path.EndsWith(".gltf")) + { + Assert.Ignore("Wrong glTF type. Skipping"); + } + Debug.Log($"Testing {path}"); + var json = File.ReadAllText(path); + var go = new GameObject(); + var deferAgent = new UninterruptedDeferAgent(); + var logger = new ConsoleLogger(); + using var gltf = new GltfImport(deferAgent: deferAgent, logger: logger); + var task = gltf.LoadGltfJson(json, new Uri(path)); + yield return Utils.WaitForTask(task); + var success = task.Result; + Assert.IsTrue(success); + var instantiator = new GameObjectInstantiator(gltf, go.transform, logger); + task = gltf.InstantiateMainSceneAsync(instantiator); + yield return Utils.WaitForTask(task); + success = task.Result; + Assert.IsTrue(success); + Object.Destroy(go); } } } diff --git a/Tests/Runtime/Scripts/Import/LoadTests.cs.meta b/Tests/Runtime/Scripts/Import/LoadTests.cs.meta index 31fde93a..4e7d590e 100644 --- a/Tests/Runtime/Scripts/Import/LoadTests.cs.meta +++ b/Tests/Runtime/Scripts/Import/LoadTests.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 81161889e3c754c72aa340372bca135b +guid: 539ae0a3ad91d4cb5850a0ac26939d86 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Tests/Runtime/Scripts/JobTests.cs b/Tests/Runtime/Scripts/JobTests.cs new file mode 100644 index 00000000..0d515aa0 --- /dev/null +++ b/Tests/Runtime/Scripts/JobTests.cs @@ -0,0 +1,1531 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System; +using GLTFast.Schema; +using GLTFast.Vertex; +using NUnit.Framework; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace GLTFast.Tests.Jobs +{ + + [TestFixture] + public class Vector3Jobs + { + + const int k_Length = 10; + float3 m_NormalizedReference = new float3(-.5f, .5f, 0.707107f); + float3 m_Reference = new float3(-1, 13, 42); + + NativeArray m_Input; + NativeArray m_InputUInt16; + NativeArray m_InputInt16; + NativeArray m_InputUInt8; + NativeArray m_InputInt8; + NativeArray m_Output; + + [OneTimeSetUp] + public void SetUpTest() + { + m_Input = new NativeArray(k_Length, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_Length * 3, Allocator.Persistent); + m_InputInt16 = new NativeArray(k_Length * 3, Allocator.Persistent); + m_InputUInt8 = new NativeArray(k_Length * 3, Allocator.Persistent); + m_InputInt8 = new NativeArray(k_Length * 3, Allocator.Persistent); + m_Output = new NativeArray(k_Length, Allocator.Persistent); + + { + m_Input[1] = new float3(.5f, .5f, 0.707107f); + + m_InputUInt8[3] = byte.MaxValue / 2; + m_InputUInt8[4] = byte.MaxValue / 2; + m_InputUInt8[5] = 180; + + m_InputInt8[3] = sbyte.MaxValue / 2; + m_InputInt8[4] = sbyte.MaxValue / 2; + m_InputInt8[5] = 90; + + m_InputUInt16[3] = ushort.MaxValue / 2; + m_InputUInt16[4] = ushort.MaxValue / 2; + m_InputUInt16[5] = (ushort)(0.707107f * ushort.MaxValue); + + m_InputInt16[3] = short.MaxValue / 2; + m_InputInt16[4] = short.MaxValue / 2; + m_InputInt16[5] = (short)(0.707107f * short.MaxValue); + } + + { + m_Input[2] = new float3(1, 13, 42); + + m_InputUInt8[6] = 1; + m_InputUInt8[7] = 13; + m_InputUInt8[8] = 42; + + m_InputInt8[6] = 1; + m_InputInt8[7] = 13; + m_InputInt8[8] = 42; + + m_InputUInt16[6] = 1; + m_InputUInt16[7] = 13; + m_InputUInt16[8] = 42; + + m_InputInt16[6] = 1; + m_InputInt16[7] = 13; + m_InputInt16[8] = 42; + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_Input.Dispose(); + m_InputUInt16.Dispose(); + m_InputInt16.Dispose(); + m_InputUInt8.Dispose(); + m_InputInt8.Dispose(); + m_Output.Dispose(); + } + + void CheckNormalizedResult(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_NormalizedReference, m_Output[i], epsilon); + } + + void CheckResult(float epsilon = float.Epsilon) + { + const int i = 2; + Utils.AssertNearOrEqual(m_Reference, m_Output[i], epsilon); + } + + [Test] + public unsafe void ConvertVector3FloatToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertVector3FloatToFloatInterleavedJob + { + inputByteStride = 12, + input = (byte*)m_Input.GetUnsafeReadOnlyPtr(), + outputByteStride = 12, + result = (float3*)m_Output.GetUnsafePtr() + }; +#if UNITY_JOBS + job.RunBatch(m_Input.Length); +#else + job.Run(m_Input.Length); +#endif + + CheckNormalizedResult(); + CheckResult(); + } + + [Test] + public unsafe void ConvertVector3FloatToFloatJob() + { + var job = new GLTFast.Jobs.ConvertVector3FloatToFloatJob + { + input = (float3*)m_Input.GetUnsafeReadOnlyPtr(), + result = (float3*)m_Output.GetUnsafePtr() + }; + job.Run(m_Input.Length); + CheckNormalizedResult(); + CheckResult(); + } + + [Test] + public unsafe void ConvertVector3Int16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertVector3Int16ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertVector3Int8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertVector3Int8ToFloatInterleavedNormalizedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt8); + } + + [Test] + public unsafe void ConvertPositionsUInt16ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsUInt16ToFloatInterleavedJob + { + input = (byte*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckResult(); + } + + [Test] + public unsafe void ConvertPositionsUInt16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsUInt16ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertPositionsInt16ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsInt16ToFloatInterleavedJob + { + input = (byte*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckResult(); + } + + [Test] + public unsafe void ConvertPositionsInt8ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsInt8ToFloatInterleavedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckResult(); + } + + [Test] + public unsafe void ConvertPositionsUInt8ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsUInt8ToFloatInterleavedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckResult(); + } + + [Test] + public unsafe void ConvertPositionsUInt8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertPositionsUInt8ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonUInt8); + } + + [Test] + public unsafe void ConvertNormalsInt16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertNormalsInt16ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertNormalsInt8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertNormalsInt8ToFloatInterleavedNormalizedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = (float3*)m_Output.GetUnsafePtr(), + outputByteStride = 12 + }; +#if UNITY_JOBS + job.RunBatch(m_Output.Length); +#else + job.Run(m_Output.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt8); + } + } + + [TestFixture] + public class PositionSparseJobs + { + + const int k_Length = 10; + + NativeArray m_Indices; + NativeArray m_Input; + NativeArray m_Output; + + [OneTimeSetUp] + public void SetUpTest() + { + m_Indices = new NativeArray(k_Length, Allocator.Persistent); + m_Input = new NativeArray(k_Length, Allocator.Persistent); + m_Output = new NativeArray(k_Length * 2, Allocator.Persistent); + + for (int i = 0; i < k_Length; i++) + { + m_Indices[i] = i * 2; + m_Input[i] = new float3(i, k_Length - 1, 42); + } + } + + void CheckResult() + { + var endIndex = math.min(k_Length, 10); + for (int i = 0; i < endIndex; i++) + { + Utils.AssertNearOrEqual(new float3(-i, k_Length - 1, 42), m_Output[i * 2]); + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_Input.Dispose(); + m_Output.Dispose(); + m_Indices.Dispose(); + } + + [Test] + public unsafe void ConvertPositionsSparseJob() + { + const GltfComponentType indexType = GltfComponentType.UnsignedInt; + const GltfComponentType valueType = GltfComponentType.Float; + const bool normalized = false; + + var job = new GLTFast.Jobs.ConvertVector3SparseJob + { + indexBuffer = m_Indices.GetUnsafeReadOnlyPtr(), + indexConverter = GLTFast.Jobs.CachedFunction.GetIndexConverter(indexType), + inputByteStride = 3 * Accessor.GetComponentTypeSize(valueType), + input = m_Input.GetUnsafeReadOnlyPtr(), + valueConverter = GLTFast.Jobs.CachedFunction.GetPositionConverter(valueType, normalized), + outputByteStride = 12, + result = (float3*)m_Output.GetUnsafePtr(), + }; + job.Run(m_Indices.Length); + CheckResult(); + } + } + + [TestFixture] + public class UVJobs + { + const int k_UVLength = 10; + float2 m_NormalizedReference = new float2(.5f, 0f); + float2 m_Reference = new float2(13, -41); + + NativeArray m_UVInput; + NativeArray m_InputUInt16; + NativeArray m_InputInt16; + NativeArray m_InputUInt8; + NativeArray m_InputInt8; + NativeArray m_UVOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_UVInput = new NativeArray(k_UVLength, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_UVLength * 2, Allocator.Persistent); + m_InputInt16 = new NativeArray(k_UVLength * 2, Allocator.Persistent); + m_InputUInt8 = new NativeArray(k_UVLength * 2, Allocator.Persistent); + m_InputInt8 = new NativeArray(k_UVLength * 2, Allocator.Persistent); + m_UVOutput = new NativeArray(k_UVLength, Allocator.Persistent); + + { + m_UVInput[1] = new float2(.5f, 1f); + + m_InputUInt8[2] = byte.MaxValue / 2; + m_InputUInt8[3] = byte.MaxValue; + + m_InputInt8[2] = SByte.MaxValue / 2; + m_InputInt8[3] = SByte.MaxValue; + + m_InputUInt16[2] = ushort.MaxValue / 2; + m_InputUInt16[3] = ushort.MaxValue; + + m_InputInt16[2] = short.MaxValue / 2; + m_InputInt16[3] = short.MaxValue; + } + + { + m_UVInput[2] = new float2(13, 42); + + m_InputUInt8[4] = 13; + m_InputUInt8[5] = 42; + + m_InputInt8[4] = 13; + m_InputInt8[5] = 42; + + m_InputUInt16[4] = 13; + m_InputUInt16[5] = 42; + + m_InputInt16[4] = 13; + m_InputInt16[5] = 42; + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_UVInput.Dispose(); + m_InputUInt16.Dispose(); + m_InputInt16.Dispose(); + m_InputUInt8.Dispose(); + m_InputInt8.Dispose(); + m_UVOutput.Dispose(); + } + + void CheckNormalizedResult(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_NormalizedReference, m_UVOutput[i], epsilon); + } + + void CheckResult(float epsilon = float.Epsilon) + { + const int i = 2; + Utils.AssertNearOrEqual(m_Reference, m_UVOutput[i], epsilon); + } + + // [Test] + // public unsafe void ConvertUVsUInt8ToFloatJob() { + // var job = new GLTFast.Jobs.ConvertUVsUInt8ToFloatJob { + // input = (byte*)m_UVInput.GetUnsafeReadOnlyPtr(), + // result = (Vector2*)m_UVOutput.GetUnsafePtr() + // }; + // job.Run(m_UVOutput.Length); + // } + // + // [Test] + // public unsafe void ConvertUVsUInt8ToFloatNormalizedJob() { + // var job = new GLTFast.Jobs.ConvertUVsUInt8ToFloatNormalizedJob { + // input = (byte*)m_UVInput.GetUnsafeReadOnlyPtr(), + // result = (Vector2*)m_UVOutput.GetUnsafePtr() + // }; + // job.Run(m_UVOutput.Length); + // } + // + // [Test] + // public unsafe void ConvertUVsUInt16ToFloatNormalizedJob() { + // var job = new GLTFast.Jobs.ConvertUVsUInt16ToFloatNormalizedJob { + // input = (ushort*)m_UVInput.GetUnsafeReadOnlyPtr(), + // result = (Vector2*)m_UVOutput.GetUnsafePtr() + // }; + // job.Run(m_UVOutput.Length); + // } + // + // [Test] + // public unsafe void ConvertUVsUInt16ToFloatJob() { + // var job = new GLTFast.Jobs.ConvertUVsUInt16ToFloatJob { + // input = (ushort*)m_UVInput.GetUnsafeReadOnlyPtr(), + // result = (Vector2*)m_UVOutput.GetUnsafePtr() + // }; + // job.Run(m_UVOutput.Length); + // } + // + // [Test] + // public unsafe void ConvertUVsFloatToFloatJob() { + // var job = new GLTFast.Jobs.ConvertUVsFloatToFloatJob { + // input = (float*)m_UVInput.GetUnsafeReadOnlyPtr(), + // result = (Vector2*)m_UVOutput.GetUnsafePtr() + // }; + // job.Run(m_UVOutput.Length); + // } + + [Test] + public unsafe void ConvertUVsUInt8ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertUVsUInt8ToFloatInterleavedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 2, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckResult(Constants.epsilonUInt8); + } + + [Test] + public unsafe void ConvertUVsUInt8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertUVsUInt8ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 2, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; + job.Run(m_UVOutput.Length); + CheckNormalizedResult(Constants.epsilonUInt8); + } + + [Test] + public unsafe void ConvertUVsUInt16ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertUVsUInt16ToFloatInterleavedJob + { + input = (byte*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckResult(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertUVsUInt16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertUVsUInt16ToFloatInterleavedNormalizedJob + { + input = (byte*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; + job.Run(m_UVOutput.Length); + CheckNormalizedResult(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertUVsInt16ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertUVsInt16ToFloatInterleavedJob + { + input = (short*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertUVsInt16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertUVsInt16ToFloatInterleavedNormalizedJob + { + input = (short*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertUVsInt8ToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertUVsInt8ToFloatInterleavedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 2, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckResult(Constants.epsilonInt8); + } + + [Test] + public unsafe void ConvertUVsInt8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertUVsInt8ToFloatInterleavedNormalizedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 2, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckNormalizedResult(Constants.epsilonInt8); + } + + [Test] + public unsafe void ConvertUVsFloatToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertUVsFloatToFloatInterleavedJob + { + input = (byte*)m_UVInput.GetUnsafeReadOnlyPtr(), + inputByteStride = 8, + result = (float2*)m_UVOutput.GetUnsafePtr(), + outputByteStride = 8 + }; +#if UNITY_JOBS + job.RunBatch(m_UVOutput.Length); +#else + job.Run(m_UVOutput.Length); +#endif + CheckResult(); + CheckNormalizedResult(); + } + } + + [TestFixture] + public class Vector4Jobs + { + const int k_RotationLength = 10; + float4 m_NormalizedReference = new float4(0.844623f, -0.191342f, -0.46194f, 0.191342f); + float4 m_NormalizedTangentReference = new float4(0.844623f, 0.191342f, -0.46194f, 0.191342f); + float4 m_RotationReference = new float4(2, -13, -42, 1); + float4 m_TangentReference = new float4(2, 13, -42, 1); + float4 m_Reference = new float4(2, 13, 42, 1); + + NativeArray m_RotInput; + NativeArray m_InputUInt16; + NativeArray m_InputInt16; + NativeArray m_InputUInt8; + NativeArray m_InputInt8; + NativeArray m_RotOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_RotInput = new NativeArray(k_RotationLength, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_RotationLength * 4, Allocator.Persistent); + m_InputInt16 = new NativeArray(k_RotationLength * 4, Allocator.Persistent); + m_InputUInt8 = new NativeArray(k_RotationLength * 4, Allocator.Persistent); + m_InputInt8 = new NativeArray(k_RotationLength * 4, Allocator.Persistent); + m_RotOutput = new NativeArray(k_RotationLength, Allocator.Persistent); + + { + var tmp = new float4(0.844623f, 0.191342f, 0.46194f, 0.191342f); + m_RotInput[1] = tmp; + + m_InputUInt8[4] = (byte)(byte.MaxValue * tmp.x); + m_InputUInt8[5] = (byte)(byte.MaxValue * tmp.y); + m_InputUInt8[6] = (byte)(byte.MaxValue * tmp.z); + m_InputUInt8[7] = (byte)(byte.MaxValue * tmp.w); + + m_InputInt8[4] = (sbyte)(sbyte.MaxValue * tmp.x); + m_InputInt8[5] = (sbyte)(sbyte.MaxValue * tmp.y); + m_InputInt8[6] = (sbyte)(sbyte.MaxValue * tmp.z); + m_InputInt8[7] = (sbyte)(sbyte.MaxValue * tmp.w); + + m_InputUInt16[4] = (ushort)(ushort.MaxValue * tmp.x); + m_InputUInt16[5] = (ushort)(ushort.MaxValue * tmp.y); + m_InputUInt16[6] = (ushort)(ushort.MaxValue * tmp.z); + m_InputUInt16[7] = (ushort)(ushort.MaxValue * tmp.w); + + m_InputInt16[4] = (short)(short.MaxValue * tmp.x); + m_InputInt16[5] = (short)(short.MaxValue * tmp.y); + m_InputInt16[6] = (short)(short.MaxValue * tmp.z); + m_InputInt16[7] = (short)(short.MaxValue * tmp.w); + } + + { + m_RotInput[2] = new float4(2, 13, 42, 1); + + m_InputUInt8[8] = 2; + m_InputUInt8[9] = 13; + m_InputUInt8[10] = 42; + m_InputUInt8[11] = 1; + + m_InputInt8[8] = 2; + m_InputInt8[9] = 13; + m_InputInt8[10] = 42; + m_InputInt8[11] = 1; + + m_InputUInt16[8] = 2; + m_InputUInt16[9] = 13; + m_InputUInt16[10] = 42; + m_InputUInt16[11] = 1; + + m_InputInt16[8] = 2; + m_InputInt16[9] = 13; + m_InputInt16[10] = 42; + m_InputInt16[11] = 1; + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_RotInput.Dispose(); + m_InputUInt16.Dispose(); + m_InputInt16.Dispose(); + m_InputUInt8.Dispose(); + m_InputInt8.Dispose(); + m_RotOutput.Dispose(); + } + + void CheckNormalizedResult(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_NormalizedReference, m_RotOutput[i], epsilon); + } + + void CheckNormalizedTangentResult(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_NormalizedTangentReference, m_RotOutput[i], epsilon); + } + + void CheckResult(float epsilon = float.Epsilon) + { + const int i = 2; + Utils.AssertNearOrEqual(m_RotationReference, m_RotOutput[i], epsilon); + } + + void CheckTangentResult(float epsilon = float.Epsilon) + { + const int i = 2; + Utils.AssertNearOrEqual(m_TangentReference, m_RotOutput[i], epsilon); + } + + void CheckBoneWeightResult(float epsilon = float.Epsilon) + { + const int i = 2; + Utils.AssertNearOrEqual(m_Reference, m_RotOutput[i], epsilon); + } + + [Test] + public unsafe void ConvertRotationsFloatToFloatJob() + { + var job = new GLTFast.Jobs.ConvertRotationsFloatToFloatJob + { + input = (float4*)m_RotInput.GetUnsafeReadOnlyPtr(), + result = (float4*)m_RotOutput.GetUnsafePtr() + }; + job.Run(m_RotOutput.Length); + CheckNormalizedResult(); + CheckResult(); + } + + [Test] + public unsafe void ConvertRotationsInt16ToFloatJob() + { + var job = new GLTFast.Jobs.ConvertRotationsInt16ToFloatJob + { + input = (short*)m_InputInt16.GetUnsafeReadOnlyPtr(), + result = (float*)m_RotOutput.GetUnsafePtr() + }; + job.Run(m_RotOutput.Length); + CheckNormalizedResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertRotationsInt8ToFloatJob() + { + m_InputInt8[0] = sbyte.MinValue; + m_InputInt8[1] = -64; + m_InputInt8[2] = 64; + m_InputInt8[3] = sbyte.MaxValue; + + var job = new GLTFast.Jobs.ConvertRotationsInt8ToFloatJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + result = (float*)m_RotOutput.GetUnsafePtr() + }; + job.Run(m_RotOutput.Length); + Utils.AssertNearOrEqual(new float4(-1, .5f, -.5f, 1), m_RotOutput[0], Constants.epsilonInt8); + CheckNormalizedResult(Constants.epsilonInt8); + } + + [Test] + public unsafe void ConvertTangentsFloatToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertTangentsFloatToFloatInterleavedJob + { + input = (byte*)m_RotInput.GetUnsafeReadOnlyPtr(), + inputByteStride = 16, + result = (float4*)m_RotOutput.GetUnsafePtr(), + outputByteStride = 16 + }; +#if UNITY_JOBS + job.RunBatch(m_RotOutput.Length); +#else + job.Run(m_RotOutput.Length); +#endif + CheckTangentResult(); + } + + [Test] + public unsafe void ConvertBoneWeightsFloatToFloatInterleavedJob() + { + var job = new GLTFast.Jobs.ConvertBoneWeightsFloatToFloatInterleavedJob + { + input = (byte*)m_RotInput.GetUnsafeReadOnlyPtr(), + inputByteStride = 16, + result = (float4*)m_RotOutput.GetUnsafePtr(), + outputByteStride = 16 + }; +#if UNITY_JOBS + job.RunBatch(m_RotOutput.Length); +#else + job.Run(m_RotOutput.Length); +#endif + CheckBoneWeightResult(); + } + + // TODO: Test ConvertBoneWeightsUInt8ToFloatInterleavedJob + // TODO: Test ConvertBoneWeightsUInt16ToFloatInterleavedJob + + [Test] + public unsafe void ConvertTangentsInt16ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertTangentsInt16ToFloatInterleavedNormalizedJob + { + input = (short*)m_InputInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 8, + result = (float4*)m_RotOutput.GetUnsafePtr(), + outputByteStride = 16 + }; +#if UNITY_JOBS + job.RunBatch(m_RotOutput.Length); +#else + job.Run(m_RotOutput.Length); +#endif + CheckNormalizedTangentResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertTangentsInt8ToFloatInterleavedNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertTangentsInt8ToFloatInterleavedNormalizedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (float4*)m_RotOutput.GetUnsafePtr(), + outputByteStride = 16 + }; +#if UNITY_JOBS + job.RunBatch(m_RotOutput.Length); +#else + job.Run(m_RotOutput.Length); +#endif + CheckNormalizedTangentResult(Constants.epsilonInt8); + } + } + + [TestFixture] + public class ColorJobs + { + const int k_ColorLength = 10; + Color m_ReferenceRGB = new Color(.13f, .42f, .95f, 1f); + Color m_ReferenceRGBA = new Color(.42f, .95f, .5f, .24f); + + NativeArray m_ColorInput; + NativeArray m_InputUInt16; + NativeArray m_InputUInt8; + NativeArray m_ColorOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_ColorInput = new NativeArray(k_ColorLength * 4, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_ColorLength * 4, Allocator.Persistent); + m_InputUInt8 = new NativeArray(k_ColorLength * 4, Allocator.Persistent); + m_ColorOutput = new NativeArray(k_ColorLength, Allocator.Persistent); + + m_ColorInput[3] = m_ReferenceRGB.r; + m_ColorInput[4] = m_ReferenceRGB.g; + m_ColorInput[5] = m_ReferenceRGB.b; + m_ColorInput[6] = m_ReferenceRGBA.b; + m_ColorInput[7] = m_ReferenceRGBA.a; + + m_InputUInt8[3] = (byte)(byte.MaxValue * m_ReferenceRGB.r); + m_InputUInt8[4] = (byte)(byte.MaxValue * m_ReferenceRGB.g); + m_InputUInt8[5] = (byte)(byte.MaxValue * m_ReferenceRGB.b); + m_InputUInt8[6] = (byte)(byte.MaxValue * m_ReferenceRGBA.b); + m_InputUInt8[7] = (byte)(byte.MaxValue * m_ReferenceRGBA.a); + + m_InputUInt16[3] = (ushort)(ushort.MaxValue * m_ReferenceRGB.r); + m_InputUInt16[4] = (ushort)(ushort.MaxValue * m_ReferenceRGB.g); + m_InputUInt16[5] = (ushort)(ushort.MaxValue * m_ReferenceRGB.b); + m_InputUInt16[6] = (ushort)(ushort.MaxValue * m_ReferenceRGBA.b); + m_InputUInt16[7] = (ushort)(ushort.MaxValue * m_ReferenceRGBA.a); + } + + [OneTimeTearDown] + public void Cleanup() + { + m_ColorInput.Dispose(); + m_InputUInt8.Dispose(); + m_InputUInt16.Dispose(); + m_ColorOutput.Dispose(); + } + + void CheckResultRGB(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_ReferenceRGB, m_ColorOutput[i], epsilon); + } + + void CheckResultRGBA(float epsilon = float.Epsilon) + { + const int i = 1; + Utils.AssertNearOrEqual(m_ReferenceRGBA, m_ColorOutput[i], epsilon); + } + + [Test] + public unsafe void ConvertColorsRGBFloatToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRGBFloatToRGBAFloatJob + { + input = (byte*)m_ColorInput.GetUnsafeReadOnlyPtr(), + inputByteStride = 12, + result = (float4*)m_ColorOutput.GetUnsafePtr() + }; + job.Run(m_ColorOutput.Length); + CheckResultRGB(); + } + + [Test] + public unsafe void ConvertColorsRGBUInt8ToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRgbUInt8ToRGBAFloatJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 3, + result = m_ColorOutput + }; + job.Run(m_ColorOutput.Length); + CheckResultRGB(Constants.epsilonUInt8); + } + + [Test] + public unsafe void ConvertColorsRGBUInt16ToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRgbUInt16ToRGBAFloatJob + { + input = (ushort*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 6, + result = m_ColorOutput + }; + job.Run(m_ColorOutput.Length); + CheckResultRGB(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertColorsRGBAUInt16ToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRgbaUInt16ToRGBAFloatJob + { + input = (ushort*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 8, + result = (float4*)m_ColorOutput.GetUnsafePtr() + }; +#if UNITY_JOBS + job.RunBatch(m_ColorOutput.Length); +#else + job.Run(m_ColorOutput.Length); +#endif + CheckResultRGBA(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertColorsRGBAFloatToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRGBAFloatToRGBAFloatJob + { + input = (byte*)m_ColorInput.GetUnsafeReadOnlyPtr(), + inputByteStride = 16, + result = (float4*)m_ColorOutput.GetUnsafePtr() + }; +#if UNITY_JOBS + job.RunBatch(m_ColorOutput.Length); +#else + job.Run(m_ColorOutput.Length); +#endif + CheckResultRGBA(Constants.epsilonUInt16); + } + + [Test] + public unsafe void ConvertColorsRGBAUInt8ToRGBAFloatJob() + { + var job = new GLTFast.Jobs.ConvertColorsRgbaUInt8ToRGBAFloatJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = m_ColorOutput + }; + job.Run(m_ColorOutput.Length); + CheckResultRGBA(Constants.epsilonUInt8); + } + } + + [TestFixture] + public class BoneIndexJobs + { + const int k_BoneIndexLength = 10; + uint4 m_Reference = new uint4(2, 3, 4, 5); + NativeArray m_InputUInt8; + NativeArray m_InputUInt16; + NativeArray m_BoneIndexOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_InputUInt8 = new NativeArray(k_BoneIndexLength * 4, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_BoneIndexLength * 4, Allocator.Persistent); + m_BoneIndexOutput = new NativeArray(k_BoneIndexLength, Allocator.Persistent); + + m_InputUInt8[4] = (byte)m_Reference.x; + m_InputUInt8[5] = (byte)m_Reference.y; + m_InputUInt8[6] = (byte)m_Reference.z; + m_InputUInt8[7] = (byte)m_Reference.w; + + m_InputUInt16[4] = (ushort)m_Reference.x; + m_InputUInt16[5] = (ushort)m_Reference.y; + m_InputUInt16[6] = (ushort)m_Reference.z; + m_InputUInt16[7] = (ushort)m_Reference.w; + } + + [OneTimeTearDown] + public void Cleanup() + { + m_InputUInt16.Dispose(); + m_InputUInt8.Dispose(); + m_BoneIndexOutput.Dispose(); + } + + void CheckResult() + { + const int i = 1; + Utils.AssertNearOrEqual(m_Reference, m_BoneIndexOutput[i]); + } + + [Test] + public unsafe void ConvertBoneJointsUInt8ToUInt32Job() + { + var job = new GLTFast.Jobs.ConvertBoneJointsUInt8ToUInt32Job + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + inputByteStride = 4, + result = (uint4*)m_BoneIndexOutput.GetUnsafePtr(), + outputByteStride = 16 + }; + job.Run(m_BoneIndexOutput.Length); + CheckResult(); + } + + [Test] + public unsafe void ConvertBoneJointsUInt16ToUInt32Job() + { + var job = new GLTFast.Jobs.ConvertBoneJointsUInt16ToUInt32Job + { + input = (byte*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + inputByteStride = 8, + result = (uint4*)m_BoneIndexOutput.GetUnsafePtr(), + outputByteStride = 16 + }; + job.Run(m_BoneIndexOutput.Length); + CheckResult(); + } + } + + [TestFixture] + public class SortJointsJobs + { + + const int k_BoneIndexLength = 24; + + NativeArray m_Input; + + [OneTimeSetUp] + public unsafe void SetUpTest() + { + m_Input = new NativeArray(k_BoneIndexLength, Allocator.Persistent); + var v = new VBones(); + var index = 0; + foreach (var i in AllFour()) + { + v.joints[i[0]] = 0; + v.joints[i[1]] = 1; + v.joints[i[2]] = 2; + v.joints[i[3]] = 3; + + v.weights[i[0]] = .5f; + v.weights[i[1]] = .25f; + v.weights[i[2]] = .20f; + v.weights[i[3]] = .05f; + m_Input[index] = v; + index++; + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_Input.Dispose(); + } + + unsafe void CheckResult() + { + foreach (var v in m_Input) + { + Assert.AreEqual(0, v.joints[0]); + Assert.AreEqual(1, v.joints[1]); + Assert.AreEqual(2, v.joints[2]); + Assert.AreEqual(3, v.joints[3]); + Assert.AreEqual(0.5f, v.weights[0]); + Assert.AreEqual(.25f, v.weights[1]); + Assert.AreEqual(.2f, v.weights[2]); + Assert.AreEqual(.05f, v.weights[3]); + } + } + + [Test] + public unsafe void SortAndRenormalizeBoneWeightsJob() + { + var job = new GLTFast.Jobs.SortAndNormalizeBoneWeightsJob() + { + bones = m_Input, + skinWeights = 4 + }; + job.Run(m_Input.Length); + CheckResult(); + } + + public static System.Collections.Generic.IEnumerable AllFour() + { + yield return new[] { 0, 1, 2, 3 }; + yield return new[] { 0, 1, 3, 2 }; + yield return new[] { 0, 2, 3, 1 }; + yield return new[] { 0, 2, 1, 3 }; + yield return new[] { 0, 3, 1, 2 }; + yield return new[] { 0, 3, 2, 1 }; + yield return new[] { 1, 3, 2, 0 }; + yield return new[] { 1, 3, 0, 2 }; + yield return new[] { 1, 2, 0, 3 }; + yield return new[] { 1, 2, 3, 0 }; + yield return new[] { 1, 0, 3, 2 }; + yield return new[] { 1, 0, 2, 3 }; + yield return new[] { 2, 0, 1, 3 }; + yield return new[] { 2, 0, 3, 1 }; + yield return new[] { 2, 1, 0, 3 }; + yield return new[] { 2, 1, 3, 0 }; + yield return new[] { 2, 3, 0, 1 }; + yield return new[] { 2, 3, 1, 0 }; + yield return new[] { 3, 0, 2, 1 }; + yield return new[] { 3, 0, 1, 2 }; + yield return new[] { 3, 2, 1, 0 }; + yield return new[] { 3, 2, 0, 1 }; + yield return new[] { 3, 1, 0, 2 }; + yield return new[] { 3, 1, 2, 0 }; + } + } + + [TestFixture] + public class MatrixJobs + { + const int k_MatrixLength = 10; + static readonly Matrix4x4 k_Reference = new Matrix4x4( + new Vector4(1, -5, -9, 13), + new Vector4(-2, 6, 10, 14), + new Vector4(-3, 7, 11, 15), + new Vector4(-4, 8, 12, 16) + ); + NativeArray m_MatrixInput; + NativeArray m_MatrixOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_MatrixInput = new NativeArray(k_MatrixLength, Allocator.Persistent); + m_MatrixOutput = new NativeArray(k_MatrixLength, Allocator.Persistent); + + m_MatrixInput[1] = new float4x4( + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16 + ); + } + + [OneTimeTearDown] + public void Cleanup() + { + m_MatrixInput.Dispose(); + m_MatrixOutput.Dispose(); + } + + [Test] + public unsafe void ConvertMatricesJob() + { + var job = new GLTFast.Jobs.ConvertMatricesJob + { + input = (float4x4*)m_MatrixInput.GetUnsafeReadOnlyPtr(), + result = (float4x4*)m_MatrixOutput.GetUnsafePtr(), + }; + job.Run(m_MatrixOutput.Length); + Assert.AreEqual(k_Reference, m_MatrixOutput[1]); + } + } + + [TestFixture] + public class IndexJobs + { + const int k_IndexLength = 12; // multiple of 3! + NativeArray m_InputUInt8; + NativeArray m_InputUInt16; + NativeArray m_InputUInt32; + NativeArray m_IndexOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_InputUInt8 = new NativeArray(k_IndexLength, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_IndexLength, Allocator.Persistent); + m_InputUInt32 = new NativeArray(k_IndexLength, Allocator.Persistent); + m_IndexOutput = new NativeArray(k_IndexLength, Allocator.Persistent); + + for (var i = 0; i < 6; i++) + { + m_InputUInt8[i] = (byte)i; + m_InputUInt16[i] = (ushort)i; + m_InputUInt32[i] = (uint)i; + } + } + + [OneTimeTearDown] + public void Cleanup() + { + m_InputUInt8.Dispose(); + m_InputUInt16.Dispose(); + m_InputUInt32.Dispose(); + m_IndexOutput.Dispose(); + } + + void CheckResult() + { + for (var i = 0; i < 6; i++) + { + Assert.AreEqual(i, m_IndexOutput[i]); + } + } + + void CheckResultFlipped() + { + Assert.AreEqual(0, m_IndexOutput[0]); + Assert.AreEqual(2, m_IndexOutput[1]); + Assert.AreEqual(1, m_IndexOutput[2]); + Assert.AreEqual(3, m_IndexOutput[3]); + Assert.AreEqual(5, m_IndexOutput[4]); + Assert.AreEqual(4, m_IndexOutput[5]); + } + + [Test] + public unsafe void CreateIndicesInt32Job() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.CreateIndicesInt32Job + { + result = (int*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length); + CheckResult(); + } + + [Test] + public unsafe void CreateIndicesInt32FlippedJob() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.CreateIndicesInt32FlippedJob + { + result = (int*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length); + Assert.AreEqual(2, m_IndexOutput[0]); + Assert.AreEqual(1, m_IndexOutput[1]); + Assert.AreEqual(0, m_IndexOutput[2]); + Assert.AreEqual(5, m_IndexOutput[3]); + Assert.AreEqual(4, m_IndexOutput[4]); + Assert.AreEqual(3, m_IndexOutput[5]); + } + + [Test] + public unsafe void ConvertIndicesUInt8ToInt32Job() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt8ToInt32Job + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + result = (int*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length); + CheckResult(); + } + + [Test] + public unsafe void ConvertIndicesUInt8ToInt32FlippedJob() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt8ToInt32FlippedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + result = (int3*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length / 3); + CheckResultFlipped(); + } + + [Test] + public unsafe void ConvertIndicesUInt16ToInt32FlippedJob() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt16ToInt32FlippedJob + { + input = (ushort*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + result = (int3*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length / 3); + CheckResultFlipped(); + } + + [Test] + public unsafe void ConvertIndicesUInt16ToInt32Job() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt16ToInt32Job + { + input = (ushort*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + result = (int*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length); + CheckResult(); + } + + [Test] + public unsafe void ConvertIndicesUInt32ToInt32Job() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt32ToInt32Job + { + input = (uint*)m_InputUInt32.GetUnsafeReadOnlyPtr(), + result = (int*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length); + CheckResult(); + } + + [Test] + public unsafe void ConvertIndicesUInt32ToInt32FlippedJob() + { + Assert.IsTrue(m_IndexOutput.Length % 3 == 0); + var job = new GLTFast.Jobs.ConvertIndicesUInt32ToInt32FlippedJob + { + input = (uint*)m_InputUInt32.GetUnsafeReadOnlyPtr(), + result = (int3*)m_IndexOutput.GetUnsafePtr() + }; + job.Run(m_IndexOutput.Length / 3); + CheckResultFlipped(); + } + } + + [TestFixture] + public class ScalarJobs + { + const int k_ScalarLength = 10; + NativeArray m_InputInt8; + NativeArray m_InputUInt8; + NativeArray m_InputInt16; + NativeArray m_InputUInt16; + NativeArray m_ScalarOutput; + + [OneTimeSetUp] + public void SetUpTest() + { + m_InputInt8 = new NativeArray(k_ScalarLength, Allocator.Persistent); + m_InputUInt8 = new NativeArray(k_ScalarLength, Allocator.Persistent); + m_InputInt16 = new NativeArray(k_ScalarLength, Allocator.Persistent); + m_InputUInt16 = new NativeArray(k_ScalarLength, Allocator.Persistent); + m_ScalarOutput = new NativeArray(k_ScalarLength, Allocator.Persistent); + + m_InputInt8[0] = sbyte.MaxValue; + m_InputUInt8[0] = byte.MaxValue; + m_InputInt16[0] = short.MaxValue; + m_InputUInt16[0] = ushort.MaxValue; + + m_InputInt8[1] = 0; + m_InputUInt8[1] = 0; + m_InputInt16[1] = 0; + m_InputUInt16[1] = 0; + + m_InputInt8[2] = sbyte.MinValue; + m_InputUInt8[2] = byte.MinValue; + m_InputInt16[2] = short.MinValue; + m_InputUInt16[2] = ushort.MinValue; + + m_InputInt8[3] = sbyte.MaxValue / 2; + m_InputUInt8[3] = byte.MaxValue / 2; + m_InputInt16[3] = short.MaxValue / 2; + m_InputUInt16[3] = ushort.MaxValue / 2; + } + + [OneTimeTearDown] + public void Cleanup() + { + m_InputInt8.Dispose(); + m_InputUInt8.Dispose(); + m_InputInt16.Dispose(); + m_InputUInt16.Dispose(); + m_ScalarOutput.Dispose(); + } + + void CheckResult(float epsilon = float.Epsilon) + { + Utils.AssertNearOrEqual(1, m_ScalarOutput[0], epsilon); + Utils.AssertNearOrEqual(0, m_ScalarOutput[1], epsilon); + Utils.AssertNearOrEqual(0, m_ScalarOutput[2], epsilon); + Utils.AssertNearOrEqual(.5f, m_ScalarOutput[3], epsilon); + } + + void CheckSignedResult(float epsilon = float.Epsilon) + { + Utils.AssertNearOrEqual(1, m_ScalarOutput[0], epsilon); + Utils.AssertNearOrEqual(0, m_ScalarOutput[1], epsilon); + Utils.AssertNearOrEqual(-1, m_ScalarOutput[2], epsilon); + Utils.AssertNearOrEqual(.5f, m_ScalarOutput[3], epsilon); + } + + [Test] + public unsafe void ConvertScalarInt8ToFloatNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertScalarInt8ToFloatNormalizedJob + { + input = (sbyte*)m_InputInt8.GetUnsafeReadOnlyPtr(), + result = m_ScalarOutput, + }; + job.Run(m_ScalarOutput.Length); + CheckSignedResult(Constants.epsilonInt8); + } + + [Test] + public unsafe void ConvertScalarUInt8ToFloatNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertScalarUInt8ToFloatNormalizedJob + { + input = (byte*)m_InputUInt8.GetUnsafeReadOnlyPtr(), + result = m_ScalarOutput, + }; + job.Run(m_ScalarOutput.Length); + CheckResult(Constants.epsilonUInt8); + } + + [Test] + public unsafe void ConvertScalarInt16ToFloatNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertScalarInt16ToFloatNormalizedJob + { + input = (short*)m_InputInt16.GetUnsafeReadOnlyPtr(), + result = m_ScalarOutput, + }; + job.Run(m_ScalarOutput.Length); + CheckSignedResult(Constants.epsilonInt16); + } + + [Test] + public unsafe void ConvertScalarUInt16ToFloatNormalizedJob() + { + var job = new GLTFast.Jobs.ConvertScalarUInt16ToFloatNormalizedJob + { + input = (ushort*)m_InputUInt16.GetUnsafeReadOnlyPtr(), + result = m_ScalarOutput, + }; + job.Run(m_ScalarOutput.Length); + CheckResult(Constants.epsilonUInt16); + } + } +} diff --git a/Tests/Runtime/Scripts/JobTests.cs.meta b/Tests/Runtime/Scripts/JobTests.cs.meta new file mode 100644 index 00000000..515f890f --- /dev/null +++ b/Tests/Runtime/Scripts/JobTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30a1d1b152d51468fbe45b4a2c79e1f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/Utils.cs b/Tests/Runtime/Scripts/Utils.cs new file mode 100644 index 00000000..88a8c6cc --- /dev/null +++ b/Tests/Runtime/Scripts/Utils.cs @@ -0,0 +1,112 @@ +// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors +// SPDX-License-Identifier: Apache-2.0 + +using System; +using System.Collections; +using System.Threading.Tasks; +using NUnit.Framework; +using Unity.Mathematics; +using UnityEngine; + +namespace GLTFast.Tests +{ + static class Utils + { + + /// + /// Wraps a in an . + /// + /// The async Task to wait form + /// Optional timeout in seconds + /// IEnumerator + /// + /// Thrown when a timout was set and the task took too long + public static IEnumerator WaitForTask(Task task, float timeout = -1) + { + var startTime = Time.realtimeSinceStartup; + + void CheckExceptionAndTimeout() + { + if (task.Exception != null) + throw task.Exception; + if (timeout > 0 && Time.realtimeSinceStartup - startTime > timeout) + { + throw new System.TimeoutException(); + } + } + while (!task.IsCompleted) + { + CheckExceptionAndTimeout(); + yield return null; + } + + CheckExceptionAndTimeout(); + } + + public static void AssertNearOrEqual(float4 reference, float4 value, float epsilon = float.Epsilon) + { + var delta = math.abs(reference - value); + var maxDelta = math.max(delta.x, math.max(delta.y, math.max(delta.z, delta.w))); + if (maxDelta > epsilon) + { + throw new AssertionException($"float4 not equal. expected {reference} got {value} (delta {maxDelta})"); + } + } + + public static void AssertNearOrEqual(float3 reference, float3 value, float epsilon = float.Epsilon) + { + var delta = math.abs(reference - value); + var maxDelta = math.max(delta.x, math.max(delta.y, delta.z)); + if (maxDelta > epsilon) + { + throw new AssertionException($"float3 not equal. expected {reference} got {value} (delta {maxDelta})"); + } + } + + public static void AssertNearOrEqual(float2 reference, float2 value, float epsilon = float.Epsilon) + { + var delta = math.abs(reference - value); + var maxDelta = math.max(delta.x, delta.y); + if (maxDelta > epsilon) + { + throw new AssertionException($"float2 not equal. expected {reference} got {value} (delta {maxDelta})"); + } + } + + public static void AssertNearOrEqual(float reference, float value, float epsilon = float.Epsilon) + { + var delta = math.abs(reference - value); + if (delta > epsilon) + { + throw new AssertionException($"float not equal. expected {reference} got {value} (delta {delta})"); + } + } + + public static void AssertNearOrEqual(Color reference, Color value, float epsilon = float.Epsilon) + { + AssertNearOrEqual( + new float4(reference.r, reference.g, reference.b, reference.a), + new float4(value.r, value.g, value.b, value.a), + epsilon + ); + } + + public static void AssertNearOrEqual(Color reference, float4 value, float epsilon = float.Epsilon) + { + AssertNearOrEqual( + new float4(reference.r, reference.g, reference.b, reference.a), + value, + epsilon + ); + } + + public static void AssertNearOrEqual(uint4 reference, uint4 value) + { + var b = reference != value; + if (b.x || b.y || b.z || b.w) + { + throw new AssertionException($"float4 not equal. expected {reference} got {value}"); + } + } + } +} diff --git a/Tests/Runtime/Scripts/Utils.cs.meta b/Tests/Runtime/Scripts/Utils.cs.meta new file mode 100644 index 00000000..d37530b1 --- /dev/null +++ b/Tests/Runtime/Scripts/Utils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c06ae487c51924137ab3c3c7041eb4d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/Scripts/glTFast.Tests.asmdef b/Tests/Runtime/Scripts/glTFast.Tests.asmdef index 1c0a345d..666ad23f 100644 --- a/Tests/Runtime/Scripts/glTFast.Tests.asmdef +++ b/Tests/Runtime/Scripts/glTFast.Tests.asmdef @@ -3,6 +3,7 @@ "rootNamespace": "GLTFast.Tests", "references": [ "UnityEngine.TestRunner", + "Unity.Burst", "Unity.Mathematics", "Unity.PerformanceTesting", "glTFast", From 39f6acaaa24f0ae10ea0df3a18b83aa4702b7a7d Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 17 Apr 2024 15:56:51 +0200 Subject: [PATCH 09/10] feat: Test Khronos glTF-Sample-Assets (#126) * refactor: Introduced static, async and re-usable `RunTestCase` method. * fix: Test cases are not confused anymore due to unique test data names. * feat: Test that imports parts of Khronos glTF-Sample-Assets. * fix: Removed invalid attempt to calculate normals or tangents on point or line meshes. * feat: `ICodeLogger.Log` for dynamic LogType usage. * fix: Consistent log message when a glTF extension cannot be supported due to a missing Unity package depenency (e.g. KTX for Unity). * All missing extensions are logged (not just the first one). * There's now a single message per missing package. * Depending on whether that extension is required the message's type is warning or error. * Added explicit message when *meshoptimizer decompression for Unity* is missing. * Minor changelog improvements. * fix: AssetsTests for glTFs that require Draco or KTX extensions are expected to fail now. * fix(ci): PR job subset and coverage job subset did not overlap, so coverage was cut short. Made sure win/2022 is part of PR subsets. * Cut Ubuntu test from PR subset. * Run *all_defines* setup on all versions on win for PRs (to ensure material generators work). * fix(ci): Expecting three coverage reports on PRs. * fix: Enabled Opaque texture setting in Universal render pipeline asset so that required shaders is consistent with shader variant collection. * doc: Added code coverage badghe to README.md * refactor: Dedicated tests for depending packages (KTX/Draco) missing or present. * refactor: Converted using directive. * feat: Added test for ICodeLogger.Log. --- .github/codecov.yml | 2 +- .yamato/package.metafile | 23 +- CHANGELOG.md | 11 +- README.md | 2 + Runtime/Scripts/GltfImport.cs | 48 +- Runtime/Scripts/Logging/CollectingLogger.cs | 10 + Runtime/Scripts/Logging/ConsoleLogger.cs | 6 + Runtime/Scripts/Logging/ICodeLogger.cs | 8 + Runtime/Scripts/PrimitiveCreateContext.cs | 23 +- .../RenderPipelineAssets/URP-Forward.asset | 81 +-- Tests/Runtime/Scripts/Import/AssetsTests.cs | 141 ++++- .../Scripts/Import/GltfTestCaseAttribute.cs | 2 +- Tests/Runtime/Scripts/LoggerTest.cs | 41 ++ Tests/Runtime/Scripts/glTFast.Tests.asmdef | 5 + .../glTF-Sample-Assets-birp.shadervariants | 289 ++++++++++ ...lTF-Sample-Assets-birp.shadervariants.meta | 8 + .../glTF-Sample-Assets-hdrp.shadervariants | 204 +++++++ ...lTF-Sample-Assets-hdrp.shadervariants.meta | 8 + .../glTF-Sample-Assets-urp.10.shadervariants | 246 +++++++++ ...F-Sample-Assets-urp.10.shadervariants.meta | 8 + .../glTF-Sample-Assets-urp.12.shadervariants | 172 ++++++ ...F-Sample-Assets-urp.12.shadervariants.meta | 8 + .../TestCaseSets/glTF-Sample-Assets.asset | 513 ++++++++++++++++++ .../glTF-Sample-Assets.asset.meta | 8 + 24 files changed, 1723 insertions(+), 144 deletions(-) create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants.meta create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset create mode 100644 Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset.meta diff --git a/.github/codecov.yml b/.github/codecov.yml index 0f74c034..507351be 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -29,7 +29,7 @@ comment: require_base: false require_head: false # Set this to the number of coverage jobs run in the PR - after_n_builds: 1 + after_n_builds: 3 flag_management: default_rules: diff --git a/.yamato/package.metafile b/.yamato/package.metafile index 1909a514..ff13bd94 100644 --- a/.yamato/package.metafile +++ b/.yamato/package.metafile @@ -11,41 +11,41 @@ test_setups: editor: 2020 - platform: mac editor: trunk - - platform: ubuntu + - platform: win editor: 2022 coverage_sets: # default for coverage: windows + current LTS - platform: win editor: 2022 - project_setup: minimalistic - editor_versions: [2020,trunk] + editor_versions: [2020,2022,trunk] platforms: [win] pr_sets: - platform: win - editor: trunk + editor: 2022 coverage_sets: # default for coverage: windows + current LTS - platform: win editor: 2022 - project_setup: all_defines render_pipeline: URP-Forward - editor_versions: [2020,trunk] + editor_versions: [2020,2021,2022,trunk] platforms: [win] pr_sets: - - platform: win - editor: trunk - coverage_sets: - # default for coverage: windows + current LTS - platform: win editor: 2022 # TODO: Move those to `urp` and `hdrp` test setup at some point # For URP/shader graph test all versions - platform: win - editor: 2021 + editor: 2020 - platform: win - editor: 2023 + editor: 2021 - platform: win editor: trunk + coverage_sets: + # default for coverage: windows + current LTS + - platform: win + editor: 2022 editor_versions: - 2020 @@ -109,6 +109,9 @@ asset_sets: - name: glTF-test-models git_uri: https://github.com/atteneder/glTF-test-models.git git_revision: fee92e61a93546e48a34773cc8d2f20db7e22873 + - name: glTF-Sample-Assets + git_uri: https://github.com/KhronosGroup/glTF-Sample-Assets.git + git_revision: cfbe2f9ac259490855940ff85feb5b4b02386046 agents: win: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d2245cf..654513b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Tests for all `GltfImport.Load` overloads. - Tests for all import Burst jobs. +- `ICodeLogger.Log` for dynamic LogType usage. ### Changed - *Emission* sub graph uses shader define `SHADEROPTIONS_PRE_EXPOSITION` for HDRP usage detection (replacing a custom function node that checked for `UNITY_HEADER_HD_INCLUDED`). @@ -18,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Shader sub graphs *BaseColor* and *Emission* are now compatible with [PolySpatial visionOS][PolySpatialVisionOS]. - On Apple visionOS, textures are always created readable, so that [PolySpatial visionOS][PolySpatialVisionOS] is able to convert them. - Draco compressed tangents import tangents correctly now. +- Removed invalid attempt to calculate normals or tangents on point or line meshes. +- Consistent log message when a glTF extension cannot be supported due to a missing Unity package depenency (e.g. [KTX for Unity][KtxForUnity]). + - All missing extensions are logged (not just the first one). + - There's now a single message per missing package. + - Depending on whether that extension is required the message's type is warning or error. + - Added explicit message when [*meshoptimizer decompression for Unity*][meshoptUnity] is missing. ## [6.3.0] - 2024-03-27 @@ -75,7 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - CI maintenance ### Fixed -- Updated references to *KTX for Unity* +- Updated references to [KTX for Unity][KtxForUnity] ## [6.0.1] - 2023-10-11 @@ -1120,10 +1127,12 @@ This release contains multiple breaking changes. Please read the [upgrade guide] [Entities1.0]: https://docs.unity3d.com/Packages/com.unity.entities@1.0 [KtxUnity]: https://github.com/atteneder/KtxUnity +[KtxForUnity]: https://docs.unity3d.com/Packages/com.unity.cloud.ktx@latest/ [DanDovi]: https://github.com/DanDovi [DracoForUnity]: https://docs.unity3d.com/Packages/com.unity.cloud.draco@latest [DracoUnity]: https://github.com/atteneder/DracoUnity [PolySpatialVisionOS]: https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@latest/ +[meshoptUnity]: https://docs.unity3d.com/Packages/com.unity.meshopt.decompress@latest/ [aurorahcx]: https://github.com/aurorahcx [Battlehub0x]: https://github.com/Battlehub0x [Bersaelor]: https://github.com/Bersaelor diff --git a/README.md b/README.md index 861d68a1..8a04bbb1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Unity glTFast +[![codecov](https://codecov.unity3d.com/ghe/unity/com.unity.cloud.gltfast.src/graph/badge.svg?token=QZYEFH0SDC)](https://codecov.unity3d.com/ghe/unity/com.unity.cloud.gltfast.src) +

Unity and glTF logos side by side

diff --git a/Runtime/Scripts/GltfImport.cs b/Runtime/Scripts/GltfImport.cs index b90ea73c..50439b42 100644 --- a/Runtime/Scripts/GltfImport.cs +++ b/Runtime/Scripts/GltfImport.cs @@ -1131,6 +1131,7 @@ bool CheckExtensionSupport(IEnumerable extensions, bool required = true) { if (extensions == null) return true; + var allExtensionsSupported = true; foreach (var ext in extensions) { var supported = k_SupportedExtensions.Contains(ext); @@ -1150,31 +1151,52 @@ bool CheckExtensionSupport(IEnumerable extensions, bool required = true) #if !DRACO_UNITY if (ext == ExtensionName.DracoMeshCompression) { - m_Logger?.Error(LogCode.PackageMissing, "Draco for Unity", ext); - + m_Logger?.Log( + required ? LogType.Error : LogType.Warning, + LogCode.PackageMissing, + "Draco for Unity", + ext + ); + } + else +#endif +#if !MESHOPT + if (ext == ExtensionName.MeshoptCompression) + { + m_Logger?.Log( + required ? LogType.Error : LogType.Warning, + LogCode.PackageMissing, + "meshoptimizer decompression for Unity", + ext + ); } + else #endif #if !KTX_UNITY if (ext == ExtensionName.TextureBasisUniversal) { - m_Logger?.Error(LogCode.PackageMissing, "KTX for Unity", ext); + m_Logger?.Log( + required ? LogType.Error : LogType.Warning, + LogCode.PackageMissing, + "KTX for Unity", + ext + ); } else #endif + if (required) { - if (required) - { - m_Logger?.Error(LogCode.ExtensionUnsupported, ext); - } - else - { - m_Logger?.Warning(LogCode.ExtensionUnsupported, ext); - } + m_Logger?.Error(LogCode.ExtensionUnsupported, ext); } - return false; + else + { + m_Logger?.Warning(LogCode.ExtensionUnsupported, ext); + } + + allExtensionsSupported = false; } } - return true; + return allExtensionsSupported; } async Task LoadGltf(string json, Uri url) diff --git a/Runtime/Scripts/Logging/CollectingLogger.cs b/Runtime/Scripts/Logging/CollectingLogger.cs index ef923624..c391650c 100644 --- a/Runtime/Scripts/Logging/CollectingLogger.cs +++ b/Runtime/Scripts/Logging/CollectingLogger.cs @@ -48,6 +48,16 @@ public void Info(LogCode code, params string[] messages) m_Items.Add(new LogItem(LogType.Log, code, messages)); } + /// + public void Log(LogType logType, LogCode code, params string[] messages) + { + if (m_Items == null) + { + m_Items = new List(); + } + m_Items.Add(new LogItem(logType, code, messages)); + } + /// public void Error(string message) { diff --git a/Runtime/Scripts/Logging/ConsoleLogger.cs b/Runtime/Scripts/Logging/ConsoleLogger.cs index abc3c413..7d0782cc 100644 --- a/Runtime/Scripts/Logging/ConsoleLogger.cs +++ b/Runtime/Scripts/Logging/ConsoleLogger.cs @@ -31,6 +31,12 @@ public void Info(LogCode code, params string[] messages) Debug.Log(LogMessages.GetFullMessage(code, messages)); } + /// + public void Log(LogType logType, LogCode code, params string[] messages) + { + Debug.unityLogger.Log(logType, LogMessages.GetFullMessage(code, messages)); + } + /// public void Error(string message) { diff --git a/Runtime/Scripts/Logging/ICodeLogger.cs b/Runtime/Scripts/Logging/ICodeLogger.cs index 907daa8f..dd9590a5 100644 --- a/Runtime/Scripts/Logging/ICodeLogger.cs +++ b/Runtime/Scripts/Logging/ICodeLogger.cs @@ -34,6 +34,14 @@ public interface ICodeLogger /// Additional, optional message parts void Info(LogCode code, params string[] messages); + /// + /// Dispatches an informational message. + /// + /// Type of message e.g. warn or error etc. + /// Message's log code + /// Additional, optional message parts + void Log(LogType logType, LogCode code, params string[] messages); + /// /// Dispatches a critical error message. /// diff --git a/Runtime/Scripts/PrimitiveCreateContext.cs b/Runtime/Scripts/PrimitiveCreateContext.cs index 53d2d6a6..f0a62c88 100644 --- a/Runtime/Scripts/PrimitiveCreateContext.cs +++ b/Runtime/Scripts/PrimitiveCreateContext.cs @@ -102,17 +102,20 @@ public void SetPrimitiveIndex(int subMesh, int primitiveIndex) } Profiler.EndSample(); - if (vertexData.calculateNormals) + if (topology == MeshTopology.Triangles || topology == MeshTopology.Quads) { - Profiler.BeginSample("RecalculateNormals"); - msh.RecalculateNormals(); - Profiler.EndSample(); - } - if (vertexData.calculateTangents) - { - Profiler.BeginSample("RecalculateTangents"); - msh.RecalculateTangents(); - Profiler.EndSample(); + if (vertexData.calculateNormals) + { + Profiler.BeginSample("RecalculateNormals"); + msh.RecalculateNormals(); + Profiler.EndSample(); + } + if (vertexData.calculateTangents) + { + Profiler.BeginSample("RecalculateTangents"); + msh.RecalculateTangents(); + Profiler.EndSample(); + } } if (allBounds.HasValue) diff --git a/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset index 41d656db..3a3bc1b5 100644 --- a/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset +++ b/Tests/Runtime/RenderPipelineAssets/URP-Forward.asset @@ -20,27 +20,13 @@ MonoBehaviour: - {fileID: 11400000, guid: 51269a86215e84a488638eeb76979978, type: 2} m_DefaultRendererIndex: 0 m_RequireDepthTexture: 0 - m_RequireOpaqueTexture: 0 + m_RequireOpaqueTexture: 1 m_OpaqueDownsampling: 1 m_SupportsTerrainHoles: 1 + m_StoreActionsOptimization: 0 m_SupportsHDR: 1 - m_HDRColorBufferPrecision: 0 m_MSAA: 1 m_RenderScale: 1 - m_UpscalingFilter: 0 - m_FsrOverrideSharpness: 0 - m_FsrSharpness: 0.92 - m_EnableLODCrossFade: 1 - m_LODCrossFadeDitheringType: 1 - m_ShEvalMode: 0 - m_LightProbeSystem: 0 - m_ProbeVolumeMemoryBudget: 1024 - m_ProbeVolumeBlendingMemoryBudget: 256 - m_SupportProbeVolumeGPUStreaming: 0 - m_SupportProbeVolumeDiskStreaming: 0 - m_SupportProbeVolumeScenarios: 0 - m_SupportProbeVolumeScenarioBlending: 0 - m_ProbeVolumeSHBands: 1 m_MainLightRenderingMode: 1 m_MainLightShadowsSupported: 1 m_MainLightShadowmapResolution: 2048 @@ -48,87 +34,26 @@ MonoBehaviour: m_AdditionalLightsPerObjectLimit: 4 m_AdditionalLightShadowsSupported: 0 m_AdditionalLightsShadowmapResolution: 512 - m_AdditionalLightsShadowResolutionTierLow: 128 - m_AdditionalLightsShadowResolutionTierMedium: 256 - m_AdditionalLightsShadowResolutionTierHigh: 512 - m_ReflectionProbeBlending: 0 - m_ReflectionProbeBoxProjection: 0 m_ShadowDistance: 50 m_ShadowCascadeCount: 1 m_Cascade2Split: 0.25 m_Cascade3Split: {x: 0.1, y: 0.3} m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} - m_CascadeBorder: 0.1 m_ShadowDepthBias: 1 m_ShadowNormalBias: 1 - m_AnyShadowsSupported: 1 m_SoftShadowsSupported: 0 - m_ConservativeEnclosingSphere: 0 - m_NumIterationsEnclosingSphere: 64 - m_SoftShadowQuality: 2 - m_AdditionalLightsCookieResolution: 2048 - m_AdditionalLightsCookieFormat: 3 m_UseSRPBatcher: 1 m_SupportsDynamicBatching: 0 m_MixedLightingSupported: 1 - m_SupportsLightCookies: 1 - m_SupportsLightLayers: 0 m_DebugLevel: 0 - m_StoreActionsOptimization: 0 m_UseAdaptivePerformance: 1 m_ColorGradingMode: 0 m_ColorGradingLutSize: 32 - m_UseFastSRGBLinearConversion: 0 - m_SupportDataDrivenLensFlare: 1 - m_SupportScreenSpaceLensFlare: 1 - m_GPUResidentDrawerMode: 0 - m_SmallMeshScreenPercentage: 0 - m_GPUResidentDrawerEnableOcclusionCullingInCameras: 0 m_ShadowType: 1 m_LocalShadowsSupported: 0 m_LocalShadowsAtlasResolution: 256 m_MaxPixelLights: 0 m_ShadowAtlasResolution: 256 - m_VolumeFrameworkUpdateMode: 0 - m_VolumeProfile: {fileID: 0} - apvScenesData: - obsoleteSceneBounds: - m_Keys: [] - m_Values: [] - obsoleteHasProbeVolumes: - m_Keys: [] - m_Values: - m_PrefilteringModeMainLightShadows: 1 - m_PrefilteringModeAdditionalLight: 4 - m_PrefilteringModeAdditionalLightShadows: 1 - m_PrefilterXRKeywords: 0 - m_PrefilteringModeForwardPlus: 1 - m_PrefilteringModeDeferredRendering: 1 - m_PrefilteringModeScreenSpaceOcclusion: 1 - m_PrefilterDebugKeywords: 0 - m_PrefilterWriteRenderingLayers: 0 - m_PrefilterHDROutput: 0 - m_PrefilterSSAODepthNormals: 0 - m_PrefilterSSAOSourceDepthLow: 0 - m_PrefilterSSAOSourceDepthMedium: 0 - m_PrefilterSSAOSourceDepthHigh: 0 - m_PrefilterSSAOInterleaved: 0 - m_PrefilterSSAOBlueNoise: 0 - m_PrefilterSSAOSampleCountLow: 0 - m_PrefilterSSAOSampleCountMedium: 0 - m_PrefilterSSAOSampleCountHigh: 0 - m_PrefilterDBufferMRT1: 0 - m_PrefilterDBufferMRT2: 0 - m_PrefilterDBufferMRT3: 0 - m_PrefilterSoftShadowsQualityLow: 0 - m_PrefilterSoftShadowsQualityMedium: 0 - m_PrefilterSoftShadowsQualityHigh: 0 - m_PrefilterSoftShadows: 0 - m_PrefilterScreenCoord: 0 - m_PrefilterNativeRenderPass: 0 - m_PrefilterUseLegacyLightmaps: 0 m_ShaderVariantLogLevel: 0 + m_VolumeFrameworkUpdateMode: 0 m_ShadowCascades: 0 - m_Textures: - blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} - bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} diff --git a/Tests/Runtime/Scripts/Import/AssetsTests.cs b/Tests/Runtime/Scripts/Import/AssetsTests.cs index af0e5bee..77ea25d6 100644 --- a/Tests/Runtime/Scripts/Import/AssetsTests.cs +++ b/Tests/Runtime/Scripts/Import/AssetsTests.cs @@ -5,7 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.IO; -using System.Linq; +using System.Threading.Tasks; using GLTFast.Logging; using NUnit.Framework; using UnityEngine; @@ -18,6 +18,93 @@ class AssetsTests { [GltfTestCase("glTF-test-models", 22)] public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); + } + + [GltfTestCase("glTF-Sample-Assets", 101, @"glTF(-JPG-PNG)?\/.*\.gltf$")] + public IEnumerator KhronosGltfSampleAssets(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); + } + + [GltfTestCase("glTF-Sample-Assets", 7, @"glTF-Binary\/.*\.glb$")] + public IEnumerator KhronosGltfSampleAssetsBinary(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); + } + + [GltfTestCase("glTF-Sample-Assets", 4, @"glTF-Draco\/.*\.gltf$")] + public IEnumerator KhronosGltfSampleAssetsDraco(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { +#if DRACO_UNITY + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); +#else + Assert.Ignore("Requires Draco for Unity package to be installed."); + yield break; +#endif + } + + [GltfTestCase("glTF-Sample-Assets", 2, @"glTF-KTX-BasisU\/.*\.gltf$")] + public IEnumerator KhronosGltfSampleAssetsKtx(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { +#if KTX_UNITY + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); +#else + Assert.Ignore("Requires KTX for Unity package to be installed."); + yield break; +#endif + } + + [GltfTestCase("glTF-Sample-Assets", 1, @"StainedGlassLamp\/glTF-KTX-BasisU\/StainedGlassLamp.gltf$")] + public IEnumerator KtxMissing(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { +#if KTX_UNITY + yield return null; + Assert.Ignore("Requires absence of KTX for Unity package."); +#else + testCase = new GltfTestCase + { + relativeUri = testCase.relativeUri, + expectLoadFail = true, + expectInstantiationFail = testCase.expectInstantiationFail, + expectedLogCodes = new[] { LogCode.PackageMissing } + }; + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); +#endif + } + + [GltfTestCase("glTF-Sample-Assets", 1, @"Box\/glTF-Draco\/Box.gltf$")] + public IEnumerator DracoMissing(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { +#if DRACO_UNITY + yield return null; + Assert.Ignore("Requires absence of Draco for Unity package."); +#else + testCase = new GltfTestCase + { + relativeUri = testCase.relativeUri, + expectLoadFail = true, + expectInstantiationFail = testCase.expectInstantiationFail, + expectedLogCodes = new[] { LogCode.PackageMissing } + }; + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); +#endif + } + + [GltfTestCase("glTF-Sample-Assets", 8, @"glTF-Embedded\/.*\.gltf$")] + public IEnumerator KhronosGltfSampleAssetsEmbedded(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); + } + + [GltfTestCase("glTF-Sample-Assets", 1, @"glTF-Quantized\/.*\.gltf$")] + public IEnumerator KhronosGltfSampleAssetsQuantized(GltfTestCaseSet testCaseSet, GltfTestCase testCase) + { + yield return AsyncWrapper.WaitForTask(RunTestCase(testCaseSet, testCase)); + } + + static async Task RunTestCase(GltfTestCaseSet testCaseSet, GltfTestCase testCase) { var go = new GameObject(); var deferAgent = new UninterruptedDeferAgent(); @@ -25,40 +112,34 @@ public IEnumerator GltfTestModels(GltfTestCaseSet testCaseSet, GltfTestCase test var path = Path.Combine(testCaseSet.RootPath, testCase.relativeUri); Debug.Log($"Loading {testCase} from {path}"); - using (var gltf = new GltfImport(deferAgent: deferAgent, logger: loadLogger)) + using var gltf = new GltfImport(deferAgent: deferAgent, logger: loadLogger); + var success = await gltf.Load(path); + if (success ^ !testCase.expectLoadFail) { - var task = gltf.Load(path); - yield return AsyncWrapper.WaitForTask(task); - var success = task.Result; - if (success ^ !testCase.expectLoadFail) + AssertLoggers(new[] { loadLogger }, testCase); + if (success) { - AssertLoggers(new[] { loadLogger }, testCase); - if (success) - { - throw new AssertionException("glTF import unexpectedly succeeded!"); - } - - throw new AssertionException("glTF import failed!"); + throw new AssertionException("glTF import unexpectedly succeeded!"); } - if (!success) - { - AssertLoggers(new[] { loadLogger }, testCase); - yield break; - } - var instantiateLogger = new CollectingLogger(); - var instantiator = new GameObjectInstantiator(gltf, go.transform, instantiateLogger); - task = gltf.InstantiateMainSceneAsync(instantiator); - yield return AsyncWrapper.WaitForTask(task); - success = task.Result; - if (!success) - { - instantiateLogger.LogAll(); - throw new AssertionException("glTF instantiation failed"); - } - Object.Destroy(go); - AssertLoggers(new[] { loadLogger, instantiateLogger }, testCase); + throw new AssertionException("glTF import failed!"); + } + + if (!success) + { + AssertLoggers(new[] { loadLogger }, testCase); + return; + } + var instantiateLogger = new CollectingLogger(); + var instantiator = new GameObjectInstantiator(gltf, go.transform, instantiateLogger); + success = await gltf.InstantiateMainSceneAsync(instantiator); + if (!success) + { + instantiateLogger.LogAll(); + throw new AssertionException("glTF instantiation failed"); } + Object.Destroy(go); + AssertLoggers(new[] { loadLogger, instantiateLogger }, testCase); } static void AssertLoggers(IEnumerable loggers, GltfTestCase testCase) diff --git a/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs b/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs index 56ffd215..684eaac4 100644 --- a/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs +++ b/Tests/Runtime/Scripts/Import/GltfTestCaseAttribute.cs @@ -78,7 +78,7 @@ IEnumerable ITestBuilder.BuildFrom(IMethodInfo method, Test suite) nameCounts[origName] = 1; } - data.SetName(name); + data.SetName(testCase.relativeUri); data.ExpectedResult = new UnityEngine.Object(); data.HasExpectedResult = true; diff --git a/Tests/Runtime/Scripts/LoggerTest.cs b/Tests/Runtime/Scripts/LoggerTest.cs index f0c5d531..0c3941f7 100644 --- a/Tests/Runtime/Scripts/LoggerTest.cs +++ b/Tests/Runtime/Scripts/LoggerTest.cs @@ -25,6 +25,30 @@ public static void CollectingLoggerTest() Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 404", items[0].ToString()); } + [Test] + public static void CollectingLoggerLogTest() + { + var r = new CollectingLogger(); + r.Log(LogType.Error, LogCode.Download, "401", "https://something.com/nowherfound.glb"); + r.Log(LogType.Assert, LogCode.Download, "402", "https://something.com/nowherfound.glb"); + r.Log(LogType.Warning, LogCode.Download, "403", "https://something.com/nowherfound.glb"); + r.Log(LogType.Log, LogCode.Download, "404", "https://something.com/nowherfound.glb"); + r.Log(LogType.Exception, LogCode.Download, "405", "https://something.com/nowherfound.glb"); + + Assert.AreEqual(5, r.Count); + var items = r.Items.ToArray(); + Assert.AreEqual(LogType.Error, items[0].Type); + Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 401", items[0].ToString()); + Assert.AreEqual(LogType.Assert, items[1].Type); + Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 402", items[1].ToString()); + Assert.AreEqual(LogType.Warning, items[2].Type); + Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 403", items[2].ToString()); + Assert.AreEqual(LogType.Log, items[3].Type); + Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 404", items[3].ToString()); + Assert.AreEqual(LogType.Exception, items[4].Type); + Assert.AreEqual("Download URL https://something.com/nowherfound.glb failed: 405", items[4].ToString()); + } + [Test] public static void ConsoleLoggerTest() { @@ -33,6 +57,23 @@ public static void ConsoleLoggerTest() LogAssert.Expect(LogType.Error, "Download URL https://something.com/nowherfound.glb failed: 404"); } + [Test] + public static void ConsoleLoggerLogTest() + { + var r = new ConsoleLogger(); + r.Log(LogType.Error, LogCode.Download, "401", "https://something.com/nowherfound.glb"); + r.Log(LogType.Assert, LogCode.Download, "402", "https://something.com/nowherfound.glb"); + r.Log(LogType.Warning, LogCode.Download, "403", "https://something.com/nowherfound.glb"); + r.Log(LogType.Log, LogCode.Download, "404", "https://something.com/nowherfound.glb"); + r.Log(LogType.Exception, LogCode.Download, "405", "https://something.com/nowherfound.glb"); + + LogAssert.Expect(LogType.Error, "Download URL https://something.com/nowherfound.glb failed: 401"); + LogAssert.Expect(LogType.Assert, "Download URL https://something.com/nowherfound.glb failed: 402"); + LogAssert.Expect(LogType.Warning, "Download URL https://something.com/nowherfound.glb failed: 403"); + LogAssert.Expect(LogType.Log, "Download URL https://something.com/nowherfound.glb failed: 404"); + LogAssert.Expect(LogType.Exception, "Download URL https://something.com/nowherfound.glb failed: 405"); + } + [Test] public static void TestLogItemEquals() { diff --git a/Tests/Runtime/Scripts/glTFast.Tests.asmdef b/Tests/Runtime/Scripts/glTFast.Tests.asmdef index 666ad23f..0b204b66 100644 --- a/Tests/Runtime/Scripts/glTFast.Tests.asmdef +++ b/Tests/Runtime/Scripts/glTFast.Tests.asmdef @@ -49,6 +49,11 @@ "name": "com.unity.cloud.draco", "expression": "5", "define": "DRACO_UNITY" + }, + { + "name": "com.unity.cloud.ktx", + "expression": "3", + "define": "KTX_UNITY" } ], "noEngineReferences": false diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants new file mode 100644 index 00000000..0d7d1278 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants @@ -0,0 +1,289 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-Sample-Assets-birp + m_Shaders: + - first: {fileID: 4800000, guid: 4340a3cf1cde6416d957808a6ac79eed, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON + passType: 0 + - keywords: _TEXTURE_TRANSFORM + passType: 0 + - first: {fileID: 4800000, guid: f853aafa0bc764a138f572608a37a73c, type: 3} + second: + variants: + - keywords: DIRECTIONAL LIGHTPROBE_SH + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _EMISSION _NORMALMAP _OCCLUSION _SPECGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _EMISSION _NORMALMAP _OCCLUSION + _SPECGLOSSMAP + passType: 4 + - keywords: POINT + passType: 5 + - keywords: POINT _NORMALMAP _OCCLUSION _SPECGLOSSMAP + passType: 5 + - keywords: + passType: 8 + - keywords: SHADOWS_DEPTH _OCCLUSION _SPECGLOSSMAP + passType: 8 + - first: {fileID: 4800000, guid: 99fa998bbbed3408aafa652b466d261d, type: 3} + second: + variants: + - keywords: DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _EMISSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _EMISSION + passType: 4 + - keywords: DIRECTIONAL INSTANCING_ON LIGHTPROBE_SH + passType: 4 + - keywords: DIRECTIONAL INSTANCING_ON LIGHTPROBE_SH VERTEXLIGHT_ON + passType: 4 + - keywords: BILLBOARD_FACE_CAMERA_POS DIRECTIONAL LIGHTPROBE_SH UNITY_HDR_ON + passType: 4 + - keywords: BILLBOARD_FACE_CAMERA_POS DIRECTIONAL LIGHTPROBE_SH UNITY_HDR_ON + VERTEXLIGHT_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHATEST_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHATEST_ON _EMISSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHATEST_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHATEST_ON _EMISSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHABLEND_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHABLEND_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHABLEND_ON _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHABLEND_ON _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHAPREMULTIPLY_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHAPREMULTIPLY_ON + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _EMISSION _METALLICGLOSSMAP _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _EMISSION _METALLICGLOSSMAP + _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHATEST_ON _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHATEST_ON _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHATEST_ON _METALLICGLOSSMAP _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHATEST_ON _METALLICGLOSSMAP + _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHABLEND_ON _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHABLEND_ON _METALLICGLOSSMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHABLEND_ON _METALLICGLOSSMAP _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHABLEND_ON _METALLICGLOSSMAP + _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP + _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP + _NORMALMAP + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _NORMALMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _NORMALMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHAPREMULTIPLY_ON _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHAPREMULTIPLY_ON _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _EMISSION _METALLICGLOSSMAP _NORMALMAP + _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _NORMALMAP + _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _EMISSION _METALLICGLOSSMAP + _NORMALMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHATEST_ON _METALLICGLOSSMAP _NORMALMAP + _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHATEST_ON _METALLICGLOSSMAP + _NORMALMAP _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP + _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP + _OCCLUSION + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _EMISSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _EMISSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _NORMALMAP _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _NORMALMAP _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _OCCLUSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _OCCLUSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _NORMALMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _NORMALMAP _OCCLUSION + _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _OCCLUSION + _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + _TEXTURE_TRANSFORM + passType: 4 + - keywords: DIRECTIONAL LIGHTPROBE_SH VERTEXLIGHT_ON _METALLICGLOSSMAP _NORMALMAP + _OCCLUSION _TEXTURE_TRANSFORM + passType: 4 + - keywords: POINT + passType: 5 + - keywords: BILLBOARD_FACE_CAMERA_POS DIRECTIONAL UNITY_HDR_ON + passType: 5 + - keywords: POINT _NORMALMAP + passType: 5 + - keywords: POINT _ALPHATEST_ON + passType: 5 + - keywords: POINT _ALPHABLEND_ON + passType: 5 + - keywords: POINT _ALPHABLEND_ON _NORMALMAP + passType: 5 + - keywords: POINT _ALPHAPREMULTIPLY_ON + passType: 5 + - keywords: POINT _METALLICGLOSSMAP + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _NORMALMAP + passType: 5 + - keywords: POINT _ALPHATEST_ON _METALLICGLOSSMAP + passType: 5 + - keywords: POINT _ALPHATEST_ON _METALLICGLOSSMAP _NORMALMAP + passType: 5 + - keywords: POINT _ALPHABLEND_ON _METALLICGLOSSMAP + passType: 5 + - keywords: POINT _ALPHABLEND_ON _METALLICGLOSSMAP _NORMALMAP + passType: 5 + - keywords: POINT _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _NORMALMAP + passType: 5 + - keywords: POINT _OCCLUSION + passType: 5 + - keywords: POINT _NORMALMAP _OCCLUSION + passType: 5 + - keywords: POINT _ALPHAPREMULTIPLY_ON _OCCLUSION + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _OCCLUSION + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + passType: 5 + - keywords: POINT _ALPHATEST_ON _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + passType: 5 + - keywords: POINT _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _OCCLUSION + passType: 5 + - keywords: POINT _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _NORMALMAP _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _OCCLUSION _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _NORMALMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 5 + - keywords: POINT _METALLICGLOSSMAP _NORMALMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 5 + - keywords: + passType: 8 + - keywords: SHADOWS_DEPTH + passType: 8 + - keywords: INSTANCING_ON SHADOWS_DEPTH + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHATEST_ON + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHABLEND_ON + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHAPREMULTIPLY_ON + passType: 8 + - keywords: SHADOWS_DEPTH _METALLICGLOSSMAP + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHATEST_ON _METALLICGLOSSMAP + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHABLEND_ON _METALLICGLOSSMAP + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP + passType: 8 + - keywords: SHADOWS_DEPTH _OCCLUSION + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHAPREMULTIPLY_ON _OCCLUSION + passType: 8 + - keywords: SHADOWS_DEPTH _METALLICGLOSSMAP _OCCLUSION + passType: 8 + - keywords: _EMISSION _METALLICGLOSSMAP _NORMALMAP _OCCLUSION + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHATEST_ON _METALLICGLOSSMAP _OCCLUSION + passType: 8 + - keywords: SHADOWS_DEPTH _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _OCCLUSION + passType: 8 + - keywords: SHADOWS_DEPTH _TEXTURE_TRANSFORM + passType: 8 + - keywords: SHADOWS_DEPTH _METALLICGLOSSMAP _TEXTURE_TRANSFORM + passType: 8 + - keywords: SHADOWS_DEPTH _OCCLUSION _TEXTURE_TRANSFORM + passType: 8 + - keywords: SHADOWS_DEPTH _METALLICGLOSSMAP _OCCLUSION _TEXTURE_TRANSFORM + passType: 8 diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants.meta new file mode 100644 index 00000000..de1cf4d4 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-birp.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 848de167d5c1e4f698694d0b9ed757b0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants new file mode 100644 index 00000000..9a8e9f0d --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants @@ -0,0 +1,204 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-Sample-Assets-hdrp + m_Shaders: + - first: {fileID: -6465566751694194690, guid: 9a07dad0f3c4e43ff8312e3b5fa42300, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _EMISSIVE _OCCLUSION + passType: 13 + - first: {fileID: -6465566751694194690, guid: c87047c884d9843f5b0f4cce282aa760, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - keywords: _TEXTURE_TRANSFORM _UV_CHANNEL_SELECT + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _TEXTURE_TRANSFORM + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST _TEXTURE_TRANSFORM + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _TEXTURE_TRANSFORM _UV_CHANNEL_SELECT + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST _TEXTURE_TRANSFORM _UV_CHANNEL_SELECT + passType: 13 + - first: {fileID: -6465566751694194690, guid: b9d29dfa1474148e792ac720cbd45122, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _DOUBLESIDED_ON + passType: 8 + - keywords: _ALPHATEST_ON _DOUBLESIDED_ON + passType: 8 + - keywords: _DISABLE_SSR_TRANSPARENT _ENABLE_FOG_ON_TRANSPARENT _SURFACE_TYPE_TRANSPARENT + passType: 8 + - keywords: _DISABLE_SSR_TRANSPARENT _DOUBLESIDED_ON _ENABLE_FOG_ON_TRANSPARENT + _SURFACE_TYPE_TRANSPARENT + passType: 8 + - keywords: INSTANCING_ON _BLENDMODE_OFF _REFRACTION_OFF + passType: 8 + - keywords: _EMISSIVE + passType: 8 + - keywords: _EMISSIVE _UV_CHANNEL_SELECT + passType: 8 + - keywords: _DOUBLESIDED_ON _EMISSIVE + passType: 8 + - keywords: _ALPHATEST_ON _DOUBLESIDED_ON _EMISSIVE + passType: 8 + - keywords: _OCCLUSION + passType: 8 + - keywords: _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 8 + - keywords: _ALPHATEST_ON _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 8 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _OCCLUSION _REFRACTION_OFF + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _BLENDMODE_OFF _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 8 + - keywords: _BLENDMODE_OFF _EMISSIVE _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 8 + - keywords: _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 8 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _OCCLUSION _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 8 + - keywords: _BLENDMODE_OFF _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _OCCLUSION _REFRACTION_OFF + passType: 12 + - keywords: _BLENDMODE_OFF _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _REFRACTION_OFF + passType: 13 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 + - keywords: _ALPHATEST_ON _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _ALPHATEST_ON _BLENDMODE_OFF _DOUBLESIDED_ON _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _DISABLE_SSR_TRANSPARENT _ENABLE_FOG_ON_TRANSPARENT _REFRACTION_OFF + _SURFACE_TYPE_TRANSPARENT + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _DISABLE_SSR_TRANSPARENT _DOUBLESIDED_ON _ENABLE_FOG_ON_TRANSPARENT + _REFRACTION_OFF _SURFACE_TYPE_TRANSPARENT + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _EMISSIVE + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _EMISSIVE _REFRACTION_OFF + passType: 13 + - keywords: _BLENDMODE_OFF _DOUBLESIDED_ON _EMISSIVE _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _DOUBLESIDED_ON _EMISSIVE _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _DOUBLESIDED_ON _EMISSIVE _REFRACTION_OFF + passType: 13 + - keywords: _ALPHATEST_ON _BLENDMODE_OFF _DOUBLESIDED_ON _EMISSIVE _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _ALPHATEST_ON _BLENDMODE_OFF _DOUBLESIDED_ON _EMISSIVE + _REFRACTION_OFF + passType: 13 + - keywords: _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST + _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: _ALPHATEST_ON _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _ALPHATEST_ON _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _DOUBLESIDED_ON _OCCLUSION _REFRACTION_OFF + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _EMISSIVE _OCCLUSION + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _EMISSIVE _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _OCCLUSION _REFRACTION_OFF _TEXTURE_TRANSFORM + passType: 13 + - keywords: DECALS_3RT _BLENDMODE_OFF _DOUBLESIDED_ON _OCCLUSION _REFRACTION_OFF + _TEXTURE_TRANSFORM + passType: 13 + - first: {fileID: -6465566751694194690, guid: 429ab83ee9ef05b4f8a76e58ea5d5ad4, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _CLEARCOAT + passType: 8 + - keywords: _BLENDMODE_OFF _CLEARCOAT _OCCLUSION + passType: 8 + - keywords: _CLEARCOAT _DOUBLESIDED_ON _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _BLENDMODE_OFF _CLEARCOAT _TEXTURE_TRANSFORM + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _CLEARCOAT + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST _CLEARCOAT + passType: 13 + - keywords: _BLENDMODE_OFF _CLEARCOAT _OCCLUSION + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_FPTL_LIGHTLIST + _BLENDMODE_OFF _CLEARCOAT _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_CLUSTERED_LIGHTLIST _CLEARCOAT _DOUBLESIDED_ON _EMISSIVE + _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS DECALS_3RT MATERIAL_QUALITY_HIGH SCREEN_SPACE_SHADOWS_OFF + SHADOW_MEDIUM USE_FPTL_LIGHTLIST _CLEARCOAT _DOUBLESIDED_ON _EMISSIVE _OCCLUSION + passType: 13 + - keywords: _BLENDMODE_OFF _CLEARCOAT _TEXTURE_TRANSFORM + passType: 13 + - keywords: DECALS_3RT SCREEN_SPACE_SHADOWS_OFF SHADOW_MEDIUM USE_FPTL_LIGHTLIST + _BLENDMODE_OFF _CLEARCOAT _TEXTURE_TRANSFORM + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants.meta new file mode 100644 index 00000000..8531df7d --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-hdrp.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa3d9cfa0a3364454bf3f874f08ffc16 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants new file mode 100644 index 00000000..c47ee64b --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants @@ -0,0 +1,246 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-Sample-Assets-urp.10 + m_Shaders: + - first: {fileID: -6465566751694194690, guid: f06cd296b834444abb6dbc0acccf9414, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _TRANSMISSION + passType: 8 + - keywords: _OCCLUSION _TRANSMISSION + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _DEPTH_NO_MSAA + passType: 13 + - keywords: _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _OCCLUSION _TRANSMISSION + passType: 13 + - first: {fileID: -6465566751694194690, guid: c9ba521fe23b44d6db1017a2d9d47a17, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _TRANSMISSION + passType: 8 + - keywords: _EMISSIVE _TRANSMISSION + passType: 8 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _EMISSIVE + _TRANSMISSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _EMISSIVE _TRANSMISSION + passType: 13 + - first: {fileID: -6465566751694194690, guid: 81efe6bcd8aa64c21b80376f539ee767, type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 0 + - keywords: _TEXTURE_TRANSFORM + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _TEXTURE_TRANSFORM + passType: 0 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _TEXTURE_TRANSFORM + _UV_CHANNEL_SELECT + passType: 0 + - keywords: + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + passType: 13 + - keywords: _TEXTURE_TRANSFORM + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _TEXTURE_TRANSFORM + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + _TEXTURE_TRANSFORM _UV_CHANNEL_SELECT + passType: 13 + - first: {fileID: -6465566751694194690, guid: 41356b46cd8884ec5b404223e1338fa0, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _EMISSIVE + _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _EMISSIVE + _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _EMISSIVE _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + _EMISSIVE _OCCLUSION + passType: 13 + - first: {fileID: -6465566751694194690, guid: 90c26dfde11bf4ff69ef936c6e6b1ed1, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: INSTANCING_ON + passType: 8 + - keywords: _EMISSIVE + passType: 8 + - keywords: _EMISSIVE _UV_CHANNEL_SELECT + passType: 8 + - keywords: _OCCLUSION + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - keywords: _EMISSIVE _TEXTURE_TRANSFORM + passType: 8 + - keywords: _OCCLUSION _TEXTURE_TRANSFORM + passType: 8 + - keywords: + passType: 13 + - keywords: INSTANCING_ON + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH + passType: 13 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: INSTANCING_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: _EMISSIVE + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE + passType: 13 + - keywords: _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _OCCLUSION + passType: 13 + - keywords: _EMISSIVE _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + _EMISSIVE _OCCLUSION + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _DEPTH_NO_MSAA _EMISSIVE _OCCLUSION + passType: 13 + - keywords: _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _TEXTURE_TRANSFORM + passType: 13 + - keywords: _EMISSIVE _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _TEXTURE_TRANSFORM + passType: 13 + - keywords: _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 + - first: {fileID: -6465566751694194690, guid: ba6d401c74b2c4f96af7edf0fe32241e, type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _EMISSIVE + passType: 8 + - keywords: _OCCLUSION + passType: 8 + - keywords: _OCCLUSION _UV_CHANNEL_SELECT + passType: 8 + - keywords: _CLEARCOAT _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _OCCLUSION _TEXTURE_TRANSFORM + passType: 8 + - keywords: + passType: 13 + - keywords: _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH _ADDITIONAL_LIGHTS _EMISSIVE + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _EMISSIVE + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _EMISSIVE + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS UNITY_HDR_ON _ADDITIONAL_LIGHTS _DEPTH_NO_MSAA + _EMISSIVE + passType: 13 + - keywords: BILLBOARD_FACE_CAMERA_POS LIGHTPROBE_SH UNITY_HDR_ON _ADDITIONAL_LIGHTS + _DEPTH_NO_MSAA _EMISSIVE + passType: 13 + - keywords: _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _OCCLUSION + passType: 13 + - keywords: _EMISSIVE _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _OCCLUSION + passType: 13 + - keywords: _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants.meta new file mode 100644 index 00000000..144c7faf --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.10.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4578d9ba95ec541f5aad2c807a572d98 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants new file mode 100644 index 00000000..bb7eb376 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants @@ -0,0 +1,172 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!200 &20000000 +ShaderVariantCollection: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: glTF-Sample-Assets-urp.12 + m_Shaders: + - first: {fileID: -6465566751694194690, guid: 9a07dad0f3c4e43ff8312e3b5fa42300, + type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _OCCLUSION _SPECULAR_SETUP + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _SPECULAR_SETUP + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS + passType: 13 + - first: {fileID: -6465566751694194690, guid: c87047c884d9843f5b0f4cce282aa760, + type: 3} + second: + variants: + - keywords: + passType: 0 + - keywords: _TEXTURE_TRANSFORM + passType: 0 + - keywords: + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - first: {fileID: -6465566751694194690, guid: b9d29dfa1474148e792ac720cbd45122, + type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: INSTANCING_ON + passType: 8 + - keywords: _ALPHATEST_ON + passType: 8 + - keywords: _ALPHATEST_ON _EMISSIVE + passType: 8 + - keywords: _ALPHATEST_ON _OCCLUSION + passType: 8 + - keywords: _ALPHATEST_ON _TRANSMISSION + passType: 8 + - keywords: _EMISSIVE + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _EMISSIVE _TEXTURE_TRANSFORM + passType: 8 + - keywords: _EMISSIVE _TRANSMISSION + passType: 8 + - keywords: _OCCLUSION + passType: 8 + - keywords: _OCCLUSION _TEXTURE_TRANSFORM + passType: 8 + - keywords: _OCCLUSION _TRANSMISSION + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - keywords: _TRANSMISSION + passType: 8 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _ALPHATEST_ON _EMISSIVE + _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _ALPHATEST_ON _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _ALPHATEST_ON _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _ALPHATEST_ON _MAIN_LIGHT_SHADOWS + _SURFACE_TYPE_TRANSPARENT _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _SURFACE_TYPE_TRANSPARENT _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _OCCLUSION _SURFACE_TYPE_TRANSPARENT _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _SURFACE_TYPE_TRANSPARENT + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _SURFACE_TYPE_TRANSPARENT _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _OCCLUSION _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _OCCLUSION _TRANSMISSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _TRANSMISSION + passType: 13 + - first: {fileID: -6465566751694194690, guid: c18c97ae1ce021b4980c5d19a54f0d3c, + type: 3} + second: + variants: + - keywords: + passType: 8 + - keywords: _EMISSIVE _OCCLUSION + passType: 8 + - keywords: _OCCLUSION + passType: 8 + - keywords: _TEXTURE_TRANSFORM + passType: 8 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _EMISSIVE _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS + _TEXTURE_TRANSFORM + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _EMISSIVE _MAIN_LIGHT_SHADOWS _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _OCCLUSION + passType: 13 + - keywords: _ADDITIONAL_LIGHTS _MAIN_LIGHT_SHADOWS _TEXTURE_TRANSFORM + passType: 13 diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants.meta b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants.meta new file mode 100644 index 00000000..d8c60259 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets-urp.12.shadervariants.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1ef59e45107742999cdf4bd4061bda6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 20000000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset new file mode 100644 index 00000000..1dc205f2 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset @@ -0,0 +1,513 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59748363cc8e485aa56e62947048bff8, type: 3} + m_Name: glTF-Sample-Assets + m_EditorClassIdentifier: + assetsRelativePath: glTF-Sample-Assets + assetsAbsolutePath: + m_TestCases: + - relativeUri: Models/AlphaBlendModeTest/glTF/AlphaBlendModeTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnimatedCube/glTF/AnimatedCube.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnimatedMorphCube/glTF/AnimatedMorphCube.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnimatedMorphCube/glTF-Quantized/AnimatedMorphCube.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnimatedTriangle/glTF/AnimatedTriangle.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnimatedTriangle/glTF-Embedded/AnimatedTriangle.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnisotropyBarnLamp/glTF-KTX-BasisU/AnisotropyBarnLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnisotropyDiscTest/glTF/AnisotropyDiscTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnisotropyRotationTest/glTF/AnisotropyRotationTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AnisotropyStrengthTest/glTF/AnisotropyStrengthTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/AttenuationTest/glTF/AttenuationTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Avocado/glTF/Avocado.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoomBox/glTF/BoomBox.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Box/glTF/Box.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Box/glTF-Binary/Box.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Box/glTF-Draco/Box.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Box/glTF-Embedded/Box.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Box With Spaces/glTF/Box With Spaces.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxAnimated/glTF/BoxAnimated.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxAnimated/glTF-Binary/BoxAnimated.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxAnimated/glTF-Embedded/BoxAnimated.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxInterleaved/glTF/BoxInterleaved.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxInterleaved/glTF-Binary/BoxInterleaved.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxInterleaved/glTF-Embedded/BoxInterleaved.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxTextured/glTF/BoxTextured.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxTextured/glTF-Binary/BoxTextured.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxTextured/glTF-Embedded/BoxTextured.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxTexturedNonPowerOfTwo/glTF/BoxTexturedNonPowerOfTwo.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BoxVertexColors/glTF/BoxVertexColors.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BrainStem/glTF/BrainStem.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/BrainStem/glTF-Draco/BrainStem.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Cameras/glTF/Cameras.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/CarbonFibre/glTF/CarbonFibre.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/CesiumMan/glTF/CesiumMan.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/CesiumMan/glTF-Draco/CesiumMan.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/ChairDamaskPurplegold/glTF/ChairDamaskPurplegold.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/ClearCoatCarPaint/glTF/ClearCoatCarPaint.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/ClearCoatTest/glTF/ClearCoatTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/ClearcoatWicker/glTF/ClearcoatWicker.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Cube/glTF/Cube.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DamagedHelmet/glTF/DamagedHelmet.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DamagedHelmet/glTF-Binary/DamagedHelmet.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DiffuseTransmissionPlant/glTF/DiffuseTransmissionPlant.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DiffuseTransmissionTeacup/glTF/DiffuseTransmissionTeacup.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DirectionalLight/glTF/DirectionalLight.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DispersionTest/glTF/DispersionTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DragonAttenuation/glTF/DragonAttenuation.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/DragonDispersion/glTF/DragonDispersion.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Duck/glTF/Duck.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/EmissiveStrengthTest/glTF/EmissiveStrengthTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/EnvironmentTest/glTF/EnvironmentTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/EnvironmentTest/glTF-IBL/EnvironmentTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Fox/glTF/Fox.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/GlamVelvetSofa/glTF/GlamVelvetSofa.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/GlassBrokenWindow/glTF/GlassBrokenWindow.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/GlassHurricaneCandleHolder/glTF/GlassHurricaneCandleHolder.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/GlassVaseFlowers/glTF/GlassVaseFlowers.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IORTestGrid/glTF/IORTestGrid.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/InterpolationTest/glTF/InterpolationTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescenceAbalone/glTF/IridescenceAbalone.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescenceDielectricSpheres/glTF/IridescenceDielectricSpheres.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescenceLamp/glTF/IridescenceLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescenceMetallicSpheres/glTF/IridescenceMetallicSpheres.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescenceSuzanne/glTF/IridescenceSuzanne.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/IridescentDishWithOlives/glTF/IridescentDishWithOlives.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/LightsPunctualLamp/glTF/LightsPunctualLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MaterialsVariantsShoe/glTF/MaterialsVariantsShoe.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MeshPrimitiveModes/glTF/MeshPrimitiveModes.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: 26000000 + - relativeUri: Models/MetalRoughSpheres/glTF/MetalRoughSpheres.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MetalRoughSpheresNoTextures/glTF/MetalRoughSpheresNoTextures.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MorphPrimitivesTest/glTF/MorphPrimitivesTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MorphPrimitivesTest/glTF-Draco/MorphPrimitivesTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MorphStressTest/glTF/MorphStressTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MultiUVTest/glTF/MultiUVTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/MultipleScenes/glTF/MultipleScenes.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/NegativeScaleTest/glTF/NegativeScaleTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/NormalTangentMirrorTest/glTF/NormalTangentMirrorTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/NormalTangentTest/glTF/NormalTangentTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/OrientationTest/glTF/OrientationTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/PrimitiveModeNormalsTest/glTF/PrimitiveModeNormalsTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/RecursiveSkeletons/glTF/RecursiveSkeletons.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/RiggedFigure/glTF/RiggedFigure.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/RiggedSimple/glTF/RiggedSimple.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SheenChair/glTF/SheenChair.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SheenCloth/glTF/SheenCloth.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SheenTestGrid/glTF/SheenTestGrid.gltf + expectLoadFail: 1 + expectInstantiationFail: 0 + expectedLogCodes: 14000000 + - relativeUri: Models/SimpleInstancing/glTF/SimpleInstancing.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleMaterial/glTF/SimpleMaterial.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleMeshes/glTF/SimpleMeshes.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleMeshes/glTF-Embedded/SimpleMeshes.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleMorph/glTF/SimpleMorph.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleSkin/glTF/SimpleSkin.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleSparseAccessor/glTF/SimpleSparseAccessor.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleSparseAccessor/glTF-Embedded/SimpleSparseAccessor.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleTexture/glTF/SimpleTexture.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SimpleTexture/glTF-Embedded/SimpleTexture.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SpecGlossVsMetalRough/glTF/SpecGlossVsMetalRough.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/SpecularSilkPouf/glTF/SpecularSilkPouf.gltf + expectLoadFail: 1 + expectInstantiationFail: 0 + expectedLogCodes: 14000000 + - relativeUri: Models/SpecularTest/glTF/SpecularTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Sponza/glTF/Sponza.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/StainedGlassLamp/glTF/StainedGlassLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/StainedGlassLamp/glTF-JPG-PNG/StainedGlassLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/StainedGlassLamp/glTF-KTX-BasisU/StainedGlassLamp.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Suzanne/glTF/Suzanne.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureCoordinateTest/glTF/TextureCoordinateTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureEncodingTest/glTF/TextureEncodingTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureLinearInterpolationTest/glTF/TextureLinearInterpolationTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureSettingsTest/glTF/TextureSettingsTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureTransformMultiTest/glTF/TextureTransformMultiTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TextureTransformTest/glTF/TextureTransformTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/ToyCar/glTF/ToyCar.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TransmissionRoughnessTest/glTF/TransmissionRoughnessTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TransmissionTest/glTF/TransmissionTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TransmissionThinwallTestGrid/glTF/TransmissionThinwallTestGrid.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/Triangle/glTF/Triangle.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/TwoSidedPlane/glTF/TwoSidedPlane.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: "Models/Unicode\u2764\u267BTest/glTF/Unicode\u2764\u267BTest.gltf" + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: "Models/Unicode\u2764\u267BTest/glTF-Binary/Unicode\u2764\u267BTest.glb" + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/UnlitTest/glTF/UnlitTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/VertexColorTest/glTF/VertexColorTest.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/VertexColorTest/glTF-Binary/VertexColorTest.glb + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/VirtualCity/glTF/VirtualCity.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: + - relativeUri: Models/XmpMetadataRoundedCube/glTF/XmpMetadataRoundedCube.gltf + expectLoadFail: 0 + expectInstantiationFail: 0 + expectedLogCodes: diff --git a/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset.meta b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset.meta new file mode 100644 index 00000000..34382995 --- /dev/null +++ b/Tests/Runtime/TestCaseSets/glTF-Sample-Assets.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 59d8776e9e3084c9a821da2a2c253f56 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From ffd1fa47acb24b6a012f01b9fe62b9579c5bf356 Mon Sep 17 00:00:00 2001 From: Andreas Atteneder Date: Wed, 17 Apr 2024 19:31:09 +0200 Subject: [PATCH 10/10] Release 6.4.0 --- CHANGELOG.md | 2 +- Runtime/Scripts/Export/Constants.cs | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 654513b4..243e4e19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [6.4.0] - 2024-04-17 ### Added - Tests for all `GltfImport.Load` overloads. diff --git a/Runtime/Scripts/Export/Constants.cs b/Runtime/Scripts/Export/Constants.cs index 6d7a4872..03f38477 100644 --- a/Runtime/Scripts/Export/Constants.cs +++ b/Runtime/Scripts/Export/Constants.cs @@ -7,7 +7,7 @@ namespace GLTFast.Export { static class Constants { - public const string version = "6.3.0"; + public const string version = "6.4.0"; internal const string mimeTypePNG = "image/png"; internal const string mimeTypeJPG = "image/jpeg"; diff --git a/package.json b/package.json index 6d08c096..c2b9f678 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.cloud.gltfast", - "version": "6.3.0", + "version": "6.4.0", "displayName": "Unity glTFast", "description": "Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor", "unity": "2020.3",