浏览代码
Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into gpu_terrain. Will fix merge afterwards.
/main
Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into gpu_terrain. Will fix merge afterwards.
/main
Yao Xiaoling
6 年前
当前提交
7ba05ba9
共有 5552 个文件被更改,包括 2850 次插入 和 2115 次删除
-
24.gitignore
-
17.gitmodules
-
18README.md
-
164build.py
-
42com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs
-
43com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Material/DiffusionProfile/DiffusionProfileSettingsEditor.cs
-
49com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitsToHDUnlitUpgrader.cs
-
10com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitUI.cs
-
50com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/BaseUnlitUI.cs
-
90com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/StandardsToHDLitMaterialUpgrader.cs
-
42com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitUI.cs
-
184com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/BaseLitUI.cs
-
386com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/StackLitUI.cs
-
63com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/BaseMaterialUI.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Editor/Material/LayeredLit/LayeredLitUI.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDBaseEditor.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorCLI.cs
-
44com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorUtils.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/VisualEnvironmentEditor.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/SkySettingsEditor.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/BakingSkyEditor.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/AtmosphericScattering/VolumetricFogEditor.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/AtmosphericScattering/LinearFogEditor.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/AtmosphericScattering/AtmosphericScatteringEditor.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Editor/com.unity.render-pipelines.high-definition.Editor.asmdef
-
99com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipelineResources/ReflectionProbesPreview.shader
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDShaderIncludePaths.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/BaseUI.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/HDShadowSettingsEditor.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/Shadows/ContactShadowsEditor.cs
-
27com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/ShadowInitParametersUI.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedShadowInitParameters.cs
-
44com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedLightLoopSettings.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedHDRenderPipelineAsset.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalLightLoopSettings.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalDecalSettings.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedFrameSettings.cs
-
77com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/RenderPipelineSettingsUI.cs
-
12com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/LightLoopSettingsUI.cs
-
17com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalLightLoopSettingsUI.cs
-
33com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs
-
85com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/FrameSettingsUI.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/SerializedHDCamera.cs
-
105com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraUI.cs
-
5com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.cs
-
10com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.Handlers.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedReflectionProxyVolumeComponent.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedProxyVolume.cs
-
50com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedInfluenceVolume.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ReflectionProxyVolumeComponentUI.cs
-
20com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeEditor.cs
-
56com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.cs
-
167com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs
-
26com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Gizmos.cs
-
153com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
-
10com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedPlanarReflectionProbe.cs
-
50com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs
-
38com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.cs
-
138com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Handles.cs
-
186com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs
-
12com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeEditor.cs
-
39com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs
-
396com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs
-
10com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Preview.cs
-
382com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDCubemapInspector.cs
-
16com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystemGUI.cs
-
18com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystem.cs
-
378com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDAssetFactory.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs.meta
-
102com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPPreprocessBuild.cs.meta
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPPreprocessBuild.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Material/Builtin/BuiltinData.hlsl
-
18com.unity.render-pipelines.high-definition/HDRP/Material/Builtin/BuiltinData.cs.hlsl
-
6com.unity.render-pipelines.high-definition/HDRP/Material/Builtin/BuiltinData.cs
-
70com.unity.render-pipelines.high-definition/HDRP/Material/GGXConvolution/RuntimeFilterIBL.cs
-
18com.unity.render-pipelines.high-definition/HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Material/GBufferManager.cs
-
17com.unity.render-pipelines.high-definition/HDRP/Material/MaterialUtilities.hlsl
-
14com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderPass/DecalSharePass.hlsl
-
208com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalUtilities.hlsl
-
5com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProperties.hlsl
-
60com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalData.hlsl
-
58com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.shader
-
51com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl
-
33com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs.hlsl
-
39com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs
-
10com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DBufferManager.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.shader
-
114com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
|
|||
[submodule "PostProcessing"] |
|||
path = PostProcessing |
|||
url = https://github.com/Unity-Technologies/PostProcessing |
|||
[submodule "com.unity.postprocessing"] |
|||
path = com.unity.postprocessing |
|||
url = https://github.com/Unity-Technologies/PostProcessing.git |
|||
[submodule "ShaderGraph"] |
|||
path = ShaderGraph |
|||
url = https://github.com/Unity-Technologies/ShaderGraph |
|||
[submodule "Tests/UTF_Core"] |
|||
path = Tests/UTF_Core |
|||
url = https://github.com/Unity-Technologies/UTF_Core.git |
|||
[submodule "Tests/UTF_Tests_HDRP"] |
|||
|
|||
path = Tests/UTF_Tests_HDRP |
|||
|
|||
url = https://github.com/Unity-Technologies/UTF_Tests_HDRP.git |
|
|||
#!/usr/bin/python -B |
|||
import os |
|||
import json |
|||
import platform |
|||
import shutil |
|||
import subprocess |
|||
import textwrap |
|||
|
|||
sub_packages = {} |
|||
sub_package_folders = {} |
|||
publish_order = [] |
|||
("com.unity.render-pipelines.core", os.path.join("ScriptableRenderPipeline", "Core")), |
|||
("com.unity.render-pipelines.high-definition", os.path.join("ScriptableRenderPipeline", "HDRenderPipeline")), |
|||
("com.unity.render-pipelines.lightweight", os.path.join("ScriptableRenderPipeline", "LightweightPipeline")) |
|||
("com.unity.render-pipelines.core", os.path.join("com.unity.render-pipelines.core")), |
|||
("com.unity.render-pipelines.lightweight", os.path.join("com.unity.render-pipelines.lightweight")), |
|||
("com.unity.render-pipelines.high-definition", os.path.join("com.unity.render-pipelines.high-definition")), |
|||
("com.unity.shadergraph", os.path.join("com.unity.shadergraph")), |
|||
("com.unity.postprocessing", os.path.join("com.unity.postprocessing")), |
|||
("com.unity.testframework.graphics", os.path.join("com.unity.testframework.graphics")), |
|||
def prepare(logger): |
|||
file_path = os.path.join("./ScriptableRenderPipeline", "master-package.json") |
|||
if os.path.isfile(file_path): |
|||
logger.info("Found master package file: {}".format(file_path)) |
|||
with open(file_path) as file: |
|||
try: |
|||
master_package = json.load(file) |
|||
except json.JSONDecodeError as e: |
|||
logger.critical(e) |
|||
exit(1) |
|||
|
|||
potential_folders = master_package["subPackages"] if "subPackages" in master_package else [] |
|||
for item in potential_folders: |
|||
file_path = os.path.join("./ScriptableRenderPipeline", item, "sub-package.json") |
|||
if os.path.isfile(file_path): |
|||
logger.info("Found sub-package file: {}".format(file_path)) |
|||
with open(file_path) as file: |
|||
try: |
|||
sub_package = json.load(file) |
|||
sub_packages[sub_package["name"]] = sub_package |
|||
sub_package_folders[sub_package["name"] |
|||
] = os.path.join("./ScriptableRenderPipeline", item) |
|||
except json.JSONDecodeError as e: |
|||
logger.critical("Error: {}".format(e)) |
|||
|
|||
if not sub_packages: |
|||
logger.critical("Error: No sub-packages found.") |
|||
exit(1) |
|||
|
|||
if "version" not in master_package: |
|||
logger.critical("Master package must contain a \"version\" field") |
|||
exit(1) |
|||
|
|||
print("Propagating master package version to sub-packages") |
|||
for sub_package in sub_packages.values(): |
|||
sub_package["version"] = master_package["version"] |
|||
|
|||
if "unity" in master_package: |
|||
print("Propagating master package Unity version to sub-packages") |
|||
for sub_package in sub_packages.values(): |
|||
sub_package["unity"] = master_package["unity"] |
|||
|
|||
if "dependencies" in master_package and master_package["dependencies"]: |
|||
print("Propagating shared dependencies:") |
|||
for name, version in master_package["dependencies"].items(): |
|||
logger.info(" {}@{}".format(name, version)) |
|||
for sub_package in sub_packages.values(): |
|||
if "dependencies" not in sub_package or not sub_package["dependencies"]: |
|||
sub_package["dependencies"] = {} |
|||
for name, version in master_package["dependencies"].items(): |
|||
sub_package["dependencies"][name] = version |
|||
|
|||
logger.info("Creating dependency tree:") |
|||
dependency_list = {} |
|||
dependency_tree = {} |
|||
for i, sub_package in enumerate(sub_packages.values()): |
|||
dependency_list[sub_package["name"]] = {} |
|||
for i, sub_package in enumerate(sub_packages.values()): |
|||
if "subDependencies" in sub_package and sub_package["subDependencies"]: |
|||
for dependency in sub_package["subDependencies"]: |
|||
dependency_list[dependency][sub_package["name"] |
|||
] = dependency_list[sub_package["name"]] |
|||
else: |
|||
dependency_tree[sub_package["name"] |
|||
] = dependency_list[sub_package["name"]] |
|||
|
|||
if not dependency_tree: |
|||
logger.critical("Dependency tree is empty. You might have a circular reference.") |
|||
exit(1) |
|||
|
|||
def print_dependency_tree(tree, indent): |
|||
for key, sub_tree in tree.items(): |
|||
print(key, " " * indent) |
|||
print_dependency_tree(sub_tree, indent + 1) |
|||
|
|||
print_dependency_tree(dependency_tree, 1) |
|||
|
|||
logger.info("Creating publish order:") |
|||
visited = set() |
|||
|
|||
def fill_publish_order(tree): |
|||
for key, sub_tree in tree.items(): |
|||
if key not in visited: |
|||
publish_order.append(key) |
|||
fill_publish_order(sub_tree) |
|||
|
|||
fill_publish_order(dependency_tree) |
|||
for name in publish_order: |
|||
logger.info(" {}".format(name)) |
|||
|
|||
print "Resolving dependencies between sub-packages:" |
|||
for sub_package in sub_packages.values(): |
|||
if "dependencies" not in sub_package or not sub_package["dependencies"]: |
|||
sub_package["dependencies"] = {} |
|||
if "subDependencies" in sub_package and sub_package["subDependencies"]: |
|||
logger.info(" {}:".format(sub_package["name"])) |
|||
for sub_dependency in sub_package["subDependencies"]: |
|||
sub_package["dependencies"][sub_dependency] = master_package["version"] |
|||
logger.info(" {}@{}".format(sub_dependency, |
|||
sub_package["dependencies"][sub_dependency])) |
|||
del sub_package["subDependencies"] |
|||
|
|||
logger.info("Writing package files:") |
|||
for name in publish_order: |
|||
sub_package = sub_packages[name] |
|||
package_path = os.path.join(sub_package_folders[name], "package.json") |
|||
logger.info(" {}:".format(package_path)) |
|||
with open(package_path, 'w') as file: |
|||
json.dump(sub_package, file, indent=4, sort_keys=True) |
|||
|
|||
import unity_package_build |
|||
for name in publish_order: |
|||
package_path = os.path.join(sub_package_folders[name]) |
|||
unity_package_build.copy_file_to_project("LICENSE.md", ".", package_path, logger) |
|||
unity_package_build.copy_file_to_project("CHANGELOG.md", ".", package_path, logger) |
|||
|
|||
def cleanup(logger): |
|||
logger.info("Reverting temporary file changes:") |
|||
files = [] |
|||
for name in publish_order: |
|||
folder = sub_package_folders[name] |
|||
files.append(os.path.join(folder, "package.json")) |
|||
for file in files: |
|||
logger.info(" {}".format(file)) |
|||
subprocess.call(["git", "checkout", file], cwd=".") |
|||
|
|||
# Prepare an empty project for editor tests |
|||
def prepare_editor_test_project(repo_path, project_path, logger): |
|||
import unity_package_build |
|||
dest_path = os.path.join(project_path, "Assets", "ScriptableRenderLoop") |
|||
unity_package_build.copy_path_to_project("ImageTemplates", repo_path, dest_path, logger) |
|||
unity_package_build.copy_path_to_project("Tests", repo_path, dest_path, logger) |
|||
unity_package_build.copy_file_to_project("SRPMARKER", repo_path, dest_path, logger) |
|||
unity_package_build.copy_file_to_project("SRPMARKER.meta", repo_path, dest_path, logger) |
|||
unity_package_build.copy_file_to_project("ImageTemplates.meta", repo_path, dest_path, logger) |
|||
unity_package_build.copy_file_to_project("Tests.meta", repo_path, dest_path, logger) |
|||
def test_packages_list(): |
|||
return [ |
|||
"com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.lightweight", |
|||
"com.unity.render-pipelines.high-definition", |
|||
"com.unity.shadergraph", |
|||
"com.unity.postprocessing" |
|||
] |
|||
|
|||
|
|||
try: |
|||
import unity_package_build |
|||
build_log = unity_package_build.setup() |
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
class SerializedGlobalDecalSettings |
|||
{ |
|||
public SerializedProperty root; |
|||
class SerializedGlobalDecalSettings |
|||
{ |
|||
public SerializedProperty root; |
|||
public SerializedProperty drawDistance; |
|||
public SerializedProperty atlasWidth; |
|||
public SerializedProperty drawDistance; |
|||
public SerializedProperty atlasWidth; |
|||
public SerializedGlobalDecalSettings(SerializedProperty root) |
|||
public SerializedGlobalDecalSettings(SerializedProperty root) |
|||
drawDistance = root.Find((GlobalDecalSettings s) => s.drawDistance); |
|||
atlasWidth = root.Find((GlobalDecalSettings s) => s.atlasWidth); |
|||
atlasHeight = root.Find((GlobalDecalSettings s) => s.atlasHeight); |
|||
drawDistance = root.Find((GlobalDecalSettings s) => s.drawDistance); |
|||
atlasWidth = root.Find((GlobalDecalSettings s) => s.atlasWidth); |
|||
atlasHeight = root.Find((GlobalDecalSettings s) => s.atlasHeight); |
|||
} |
|||
} |
|||
} |
|
|||
using System.Collections; |
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEditor.Experimental.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
public class ScreenSpaceRefractionEditor : VolumeComponentEditor |
|||
public class ScreenSpaceRefractionEditor : ScreenSpaceLightingEditor |
|||
SerializedDataParameter m_RayMinLevel; |
|||
SerializedDataParameter m_RayMaxLevel; |
|||
SerializedDataParameter m_RayMaxIterations; |
|||
SerializedDataParameter m_RayDepthSuccessBias; |
|||
SerializedDataParameter m_ScreenWeightDistance; |
|||
|
|||
public override void OnEnable() |
|||
{ |
|||
var o = new PropertyFetcher<ScreenSpaceRefraction>(serializedObject); |
|||
|
|||
m_RayMinLevel = Unpack(o.Find(x => x.rayMinLevel)); |
|||
m_RayMaxLevel = Unpack(o.Find(x => x.rayMaxLevel)); |
|||
m_RayMaxIterations = Unpack(o.Find(x => x.rayMaxIterations)); |
|||
m_RayDepthSuccessBias = Unpack(o.Find(x => x.rayDepthSuccessBias)); |
|||
m_ScreenWeightDistance = Unpack(o.Find(x => x.screenWeightDistance)); |
|||
} |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
EditorGUILayout.LabelField(CoreEditorUtils.GetContent("HiZ Settings")); |
|||
PropertyField(m_RayMinLevel, CoreEditorUtils.GetContent("Ray Min Level")); |
|||
PropertyField(m_RayMaxLevel, CoreEditorUtils.GetContent("Ray Max Level")); |
|||
PropertyField(m_RayMaxIterations, CoreEditorUtils.GetContent("Ray Max Iterations")); |
|||
PropertyField(m_RayDepthSuccessBias, CoreEditorUtils.GetContent("Ray Depth Success Bias")); |
|||
|
|||
EditorGUILayout.Separator(); |
|||
EditorGUILayout.LabelField(CoreEditorUtils.GetContent("Common Settings")); |
|||
PropertyField(m_ScreenWeightDistance, CoreEditorUtils.GetContent("Screen Weight Distance")); |
|||
} |
|||
} |
|||
} |
|
|||
#ifndef SHADERPASS |
|||
#ifndef SHADERPASS |
|||
#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) |
|||
#define ATTRIBUTES_NEED_NORMAL |
|||
#define ATTRIBUTES_NEED_TANGENT // Always present as we require it also in case of anisotropic lighting |
|||
#define ATTRIBUTES_NEED_TEXCOORD0 |
|||
|
|||
#define VARYINGS_NEED_POSITION_WS |
|||
#define VARYINGS_NEED_TANGENT_TO_WORLD |
|||
#define VARYINGS_NEED_TEXCOORD0 |
|||
#endif |
|||
|
|||
#include "../../ShaderPass/VaryingMesh.hlsl" |
|||
#include "HDRP/ShaderPass/VaryingMesh.hlsl" |
|
|||
//------------------------------------------------------------------------------------- |
|||
//------------------------------------------------------------------------------------- |
|||
#include "CoreRP/ShaderLibrary/EntityLighting.hlsl" |
|||
#include "../MaterialUtilities.hlsl" |
|||
#if (SHADERPASS == SHADERPASS_DBUFFER_PROJECTOR) |
|||
#elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) |
|||
void GetSurfaceData(FragInputs input, out DecalSurfaceData surfaceData) |
|||
#endif |
|||
surfaceData.baseColor = float4(0,0,0,0); |
|||
surfaceData.normalWS = float4(0,0,0,0); |
|||
surfaceData.mask = float4(0,0,0,0); |
|||
surfaceData.HTileMask = 0; |
|||
float totalBlend = clamp(normalToWorld[0][3], 0.0f, 1.0f); |
|||
surfaceData.baseColor = _BaseColor; |
|||
surfaceData.normalWS = float4(0,0,0,0); |
|||
surfaceData.mask = float4(0,0,0,0); |
|||
surfaceData.HTileMask = 0; |
|||
#if (SHADERPASS == SHADERPASS_DBUFFER_PROJECTOR) |
|||
float totalBlend = clamp(normalToWorld[0][3], 0.0f, 1.0f); |
|||
float2 scale = float2(normalToWorld[3][0], normalToWorld[3][1]); |
|||
float2 offset = float2(normalToWorld[3][2], normalToWorld[3][3]); |
|||
float2 texCoords = texCoordDS * scale + offset; |
|||
#elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) |
|||
float totalBlend = _DecalBlend; |
|||
float2 texCoords = input.texCoord0; |
|||
#endif |
|||
|
|||
surfaceData.baseColor = SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, texCoordDS.xy); |
|||
surfaceData.baseColor *= SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, texCoords); |
|||
#endif |
|||
totalBlend = surfaceData.baseColor.w; // base alpha affects all other channels; |
|||
totalBlend = surfaceData.baseColor.w; // base alpha affects all other channels; |
|||
|
|||
// outside _COLORMAP because we still have base color |
|||
#if _ALBEDOCONTRIBUTION |
|||
#else |
|||
surfaceData.baseColor.w = 0; // dont blend any albedo |
|||
|
|||
surfaceData.normalWS.xyz = mul((float3x3)normalToWorld, UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, texCoordDS))) * 0.5f + 0.5f; |
|||
surfaceData.normalWS.w = totalBlend; |
|||
surfaceData.HTileMask |= DBUFFERHTILEBIT_NORMAL; |
|||
float3 normalTS = UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, texCoords)); |
|||
#if (SHADERPASS == SHADERPASS_DBUFFER_PROJECTOR) |
|||
float3 normalWS = mul((float3x3)normalToWorld, normalTS); |
|||
#elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) |
|||
float3 normalWS; |
|||
GetNormalWS(input, 0, normalTS, normalWS); |
|||
surfaceData.normalWS.xyz = normalWS * 0.5f + 0.5f; |
|||
surfaceData.normalWS.w = totalBlend; |
|||
surfaceData.HTileMask |= DBUFFERHTILEBIT_NORMAL; |
|||
#endif |
|||
|
|||
surfaceData.mask = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, texCoordDS.xy); |
|||
surfaceData.mask.z = surfaceData.mask.w; |
|||
surfaceData.mask.w = totalBlend; |
|||
surfaceData.HTileMask |= DBUFFERHTILEBIT_MASK; |
|||
surfaceData.mask = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, texCoords); |
|||
surfaceData.mask.z = surfaceData.mask.w; |
|||
surfaceData.mask.w = totalBlend; |
|||
surfaceData.HTileMask |= DBUFFERHTILEBIT_MASK; |
|||
#endif |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue