浏览代码
Revert "Revert "Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into xrsettings""
Revert "Revert "Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into xrsettings""
This reverts commit ec4368043e0e48024a999926b30a6d885a9c6d5d./main
Nerites
6 年前
当前提交
5182ab18
共有 137 个文件被更改,包括 2480 次插入 和 1110 次删除
-
2com.unity.render-pipelines.core/CoreRP/Editor/Debugging/DebugWindow.cs
-
8com.unity.render-pipelines.core/CoreRP/Shadow/AdditionalShadowData.cs
-
21com.unity.render-pipelines.high-definition/CHANGELOG.md
-
38com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Debug/DebugDisplay.cs
-
35com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.cs
-
30com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystem.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystemGUI.cs
-
196com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
-
21com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.ProbeUtility.cs
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs
-
55com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
-
5com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs
-
162com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs
-
1com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalDecalSettings.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitPassForward.template
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
-
35com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
-
27com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs
-
63com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopSettings.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/cleardispatchindirect.compute
-
23com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs.meta
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/ReflectionProxyVolumeComponent.cs.meta
-
22com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DBufferManager.cs
-
23com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs
-
42com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs.hlsl
-
134com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl
-
422com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.shader
-
42com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalData.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProjectorComponent.cs
-
32com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalSystem.cs
-
103com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalUtilities.hlsl
-
1com.unity.render-pipelines.high-definition/HDRP/Material/Decal/GlobalDecalSettings.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLit.shader
-
3com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
-
11com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader
-
3com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Material.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader
-
20com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
-
35com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
-
20com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs
-
10com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Settings/FrameSettings.cs
-
81com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
-
94com.unity.render-pipelines.high-definition/HDRP/ShaderVariables.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesFunctions.hlsl
-
3com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesMatrixDefsHDCamera.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesMatrixDefsLegacyUnity.hlsl
-
183com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightPBRSubShader.cs
-
183com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightUnlitSubShader.cs
-
44com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRExtraPasses.template
-
44com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitExtraPasses.template
-
28com.unity.shadergraph/CHANGELOG.md
-
2com.unity.shadergraph/Editor/Data/Graphs/TextureShaderProperty.cs
-
13com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs
-
10com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs
-
2com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs
-
12com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs
-
2com.unity.shadergraph/Editor/Drawing/Views/Slots/TextureSlotControlView.cs
-
2com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/OpaqueAtmosphericScattering.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering/AtmosphericScattering.cs.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Icons.meta
-
188com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs.meta
-
39com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering.meta
-
68com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting.meta
-
5com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl.meta
-
18com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl.meta
-
3com.unity.shadergraph/.data/normal_derive_nodes.PNG
-
3com.unity.shadergraph/.data/texel_size_node.PNG
-
436com.unity.shadergraph/.data/wave_form_nodes.PNG
-
131com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromHeightNode.cs.meta
-
39com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalReconstructZNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalReconstructZNode.cs.meta
-
52com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs.meta
-
8com.unity.shadergraph/Editor/Data/Nodes/Math/Wave.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 97dc5286d61263d47b2705992cffe2d9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
partial class HDReflectionProbeEditor |
|||
{ |
|||
static Mesh sphere; |
|||
static Material material; |
|||
|
|||
[DrawGizmo(GizmoType.Active)] |
|||
static void RenderGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType) |
|||
{ |
|||
var e = GetEditorFor(reflectionProbe); |
|||
if (e == null || !e.sceneViewEditing) |
|||
return; |
|||
|
|||
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>(); |
|||
|
|||
switch (EditMode.editMode) |
|||
{ |
|||
// Influence editing
|
|||
case EditMode.SceneViewEditMode.ReflectionProbeBox: |
|||
Gizmos_Influence(reflectionProbe, reflectionData, e, true); |
|||
break; |
|||
// Influence fade editing
|
|||
case EditMode.SceneViewEditMode.GridBox: |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, e, InfluenceType.Standard, true); |
|||
break; |
|||
// Influence normal fade editing
|
|||
case EditMode.SceneViewEditMode.Collider: |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, e, InfluenceType.Normal, true); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
[DrawGizmo(GizmoType.Selected)] |
|||
static void DrawSelectedGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType) |
|||
{ |
|||
var e = GetEditorFor(reflectionProbe); |
|||
if (e == null) |
|||
return; |
|||
|
|||
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>(); |
|||
Gizmos_CapturePoint(reflectionProbe, reflectionData, e); |
|||
|
|||
if (!e.sceneViewEditing) |
|||
return; |
|||
|
|||
//Gizmos_Influence(reflectionProbe, reflectionData, e, false);
|
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Standard, false); |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Normal, false); |
|||
|
|||
DrawVerticalRay(reflectionProbe.transform); |
|||
} |
|||
|
|||
static void Gizmos_InfluenceFade(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, InfluenceType type, bool isEdit) |
|||
{ |
|||
var col = Gizmos.color; |
|||
var mat = Gizmos.matrix; |
|||
|
|||
Gizmo6FacesBoxContained box; |
|||
Vector3 boxCenterOffset; |
|||
Vector3 boxSizeOffset; |
|||
float sphereRadiusOffset; |
|||
Color color; |
|||
switch (type) |
|||
{ |
|||
default: |
|||
case InfluenceType.Standard: |
|||
{ |
|||
box = e != null ? e.m_UIState.alternativeBoxBlendHandle : null; |
|||
boxCenterOffset = a.boxBlendCenterOffset; |
|||
boxSizeOffset = a.boxBlendSizeOffset; |
|||
sphereRadiusOffset = a.sphereBlendRadiusOffset; |
|||
color = isEdit ? k_GizmoThemeColorInfluenceBlendFace : k_GizmoThemeColorInfluenceBlend; |
|||
break; |
|||
} |
|||
case InfluenceType.Normal: |
|||
{ |
|||
box = e != null ? e.m_UIState.alternativeBoxBlendNormalHandle : null; |
|||
boxCenterOffset = a.boxBlendNormalCenterOffset; |
|||
boxSizeOffset = a.boxBlendNormalSizeOffset; |
|||
sphereRadiusOffset = a.sphereBlendNormalRadiusOffset; |
|||
color = isEdit ? k_GizmoThemeColorInfluenceNormalBlendFace : k_GizmoThemeColorInfluenceNormalBlend; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p); |
|||
switch (a.influenceShape) |
|||
{ |
|||
case ShapeType.Box: |
|||
{ |
|||
Gizmos.color = color; |
|||
if (e != null) // e == null may occure when editor have still not been created at selection while the tool is not used for this part
|
|||
{ |
|||
box.DrawHull(isEdit); |
|||
} |
|||
else |
|||
{ |
|||
if (isEdit) |
|||
Gizmos.DrawCube(p.center + boxCenterOffset, p.size + boxSizeOffset); |
|||
else |
|||
Gizmos.DrawWireCube(p.center + boxCenterOffset, p.size + boxSizeOffset); |
|||
} |
|||
break; |
|||
} |
|||
case ShapeType.Sphere: |
|||
{ |
|||
Gizmos.color = color; |
|||
if (isEdit) |
|||
Gizmos.DrawSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset); |
|||
else |
|||
Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = mat; |
|||
Gizmos.color = col; |
|||
} |
|||
|
|||
static void Gizmos_Influence(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, bool isEdit) |
|||
{ |
|||
var col = Gizmos.color; |
|||
var mat = Gizmos.matrix; |
|||
|
|||
Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p); |
|||
switch (a.influenceShape) |
|||
{ |
|||
case ShapeType.Box: |
|||
{ |
|||
Gizmos.color = k_GizmoThemeColorExtentFace; |
|||
e.m_UIState.alternativeBoxInfluenceHandle.DrawHull(isEdit); |
|||
break; |
|||
} |
|||
case ShapeType.Sphere: |
|||
{ |
|||
Gizmos.color = k_GizmoThemeColorExtentFace; |
|||
if (isEdit) |
|||
Gizmos.DrawSphere(p.center, a.influenceSphereRadius); |
|||
else |
|||
Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = mat; |
|||
Gizmos.color = col; |
|||
} |
|||
|
|||
static void DrawVerticalRay(Transform transform) |
|||
{ |
|||
Ray ray = new Ray(transform.position, Vector3.down); |
|||
RaycastHit hit; |
|||
if (Physics.Raycast(ray, out hit)) |
|||
{ |
|||
Handles.color = Color.green; |
|||
Handles.zTest = UnityEngine.Rendering.CompareFunction.LessEqual; |
|||
Handles.DrawLine(transform.position - Vector3.up * 0.5f, hit.point); |
|||
Handles.DrawWireDisc(hit.point, hit.normal, 0.5f); |
|||
|
|||
Handles.color = Color.red; |
|||
Handles.zTest = UnityEngine.Rendering.CompareFunction.Greater; |
|||
Handles.DrawLine(transform.position, hit.point); |
|||
Handles.DrawWireDisc(hit.point, hit.normal, 0.5f); |
|||
} |
|||
} |
|||
|
|||
static void Gizmos_CapturePoint(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e) |
|||
{ |
|||
if(sphere == null) |
|||
{ |
|||
sphere = Resources.GetBuiltinResource<Mesh>("New-Sphere.fbx"); |
|||
} |
|||
if(material == null) |
|||
{ |
|||
material = new Material(Shader.Find("Debug/ReflectionProbePreview")); |
|||
} |
|||
material.SetTexture("_Cubemap", p.texture); |
|||
material.SetPass(0); |
|||
Graphics.DrawMeshNow(sphere, Matrix4x4.TRS(p.transform.position, Quaternion.identity, Vector3.one)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f0521a8f59de2c548bc5a6796cd32be9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEditor.IMGUI.Controls; |
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
partial class HDReflectionProbeEditor |
|||
{ |
|||
internal static Color k_GizmoThemeColorExtent = new Color(255f / 255f, 229f / 255f, 148f / 255f, 80f / 255f); |
|||
internal static Color k_GizmoThemeColorExtentFace = new Color(255f / 255f, 229f / 255f, 148f / 255f, 45f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceBlend = new Color(83f / 255f, 255f / 255f, 95f / 255f, 75f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceBlendFace = new Color(83f / 255f, 255f / 255f, 95f / 255f, 17f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceNormalBlend = new Color(0f / 255f, 229f / 255f, 255f / 255f, 80f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceNormalBlendFace = new Color(0f / 255f, 229f / 255f, 255f / 255f, 36f / 255f); |
|||
internal static Color k_GizmoThemeColorProjection = new Color(0x00 / 255f, 0xE5 / 255f, 0xFF / 255f, 0x20 / 255f); |
|||
internal static Color k_GizmoThemeColorProjectionFace = new Color(0x00 / 255f, 0xE5 / 255f, 0xFF / 255f, 0x20 / 255f); |
|||
internal static Color k_GizmoThemeColorDisabled = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f); |
|||
internal static Color k_GizmoThemeColorDisabledFace = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f); |
|||
|
|||
internal static readonly Color[][] k_handlesColor = new Color[][] |
|||
{ |
|||
new Color[] |
|||
{ |
|||
Color.red, |
|||
Color.green, |
|||
Color.blue |
|||
}, |
|||
new Color[] |
|||
{ |
|||
new Color(.5f, 0f, 0f, 1f), |
|||
new Color(0f, .5f, 0f, 1f), |
|||
new Color(0f, 0f, .5f, 1f) |
|||
} |
|||
}; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4bdc573336d075b419133b489a094c6a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 41811d2641d454a48819f6e50a816af9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
|
|||
#define MAX_ENV2D_LIGHT 32 |
|||
|
|||
uint _DirectionalLightCount; |
|||
uint _PunctualLightCount; |
|||
uint _AreaLightCount; |
|||
uint _EnvLightCount; |
|||
uint _EnvProxyCount; |
|||
int _EnvLightSkyEnabled; // TODO: make it a bool |
|||
|
|||
uint _NumTileFtplX; |
|||
uint _NumTileFtplY; |
|||
|
|||
// these uniforms are only needed for when OPAQUES_ONLY is NOT defined |
|||
// but there's a problem with our front-end compilation of compute shaders with multiple kernels causing it to error |
|||
//#ifdef USE_CLUSTERED_LIGHTLIST |
|||
float4x4 g_mInvScrProjection; // TODO: remove, unused in HDRP |
|||
|
|||
float g_fClustScale; |
|||
float g_fClustBase; |
|||
float g_fNearPlane; |
|||
float g_fFarPlane; |
|||
int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible |
|||
|
|||
uint g_isLogBaseBufferEnabled; |
|||
//#endif |
|||
|
|||
//#ifdef USE_CLUSTERED_LIGHTLIST |
|||
uint _NumTileClusteredX; |
|||
uint _NumTileClusteredY; |
|||
|
|||
float4x4 _Env2DCaptureVP[MAX_ENV2D_LIGHT]; |
|||
|
|||
#else |
|||
|
|||
#include "HDRP/Lighting/LightDefinition.cs.hlsl" |
|||
#include "CoreRP/Shadow/ShadowBase.cs.hlsl" |
|||
|
|||
StructuredBuffer<uint> g_vLightListGlobal; // don't support Buffer yet in unity |
|||
|
|||
StructuredBuffer<uint> g_vLayeredOffsetsBuffer; // don't support Buffer yet in unity |
|||
StructuredBuffer<float> g_logBaseBuffer; // don't support Buffer yet in unity |
|||
//#endif |
|||
|
|||
#ifdef USE_INDIRECT |
|||
StructuredBuffer<uint> g_TileFeatureFlags; |
|||
#endif |
|||
|
|||
StructuredBuffer<DirectionalLightData> _DirectionalLightDatas; |
|||
StructuredBuffer<LightData> _LightDatas; |
|||
StructuredBuffer<EnvLightData> _EnvLightDatas; |
|||
StructuredBuffer<ShadowData> _ShadowDatas; |
|||
|
|||
// Used by directional and spot lights |
|||
TEXTURE2D_ARRAY(_CookieTextures); |
|||
|
|||
// Used by point lights |
|||
TEXTURECUBE_ARRAY_ABSTRACT(_CookieCubeTextures); |
|||
|
|||
// Use texture array for reflection (or LatLong 2D array for mobile) |
|||
TEXTURECUBE_ARRAY_ABSTRACT(_EnvCubemapTextures); |
|||
TEXTURE2D_ARRAY(_Env2DTextures); |
|||
|
|||
// XRTODO: Need to stereo-ize access |
|||
TEXTURE2D(_DeferredShadowTexture); |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 63d561c067f228044bff7c3922047bf2 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8201940de2426934dbd592ff5cf182c9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
uint _EnableDBuffer; |
|||
float2 _DecalAtlasResolution; |
|||
#else |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 9f6cea0783427804084f429e8502ad33 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
#include "HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs.hlsl" |
|||
|
|||
// Warning: Unity is not able to losslessly transfer integers larger than 2^24 to the shader system. |
|||
// Therefore, we bitcast uint to float in C#, and bitcast back to uint in the shader. |
|||
uint _EnableSubsurfaceScattering; // Globally toggles subsurface and transmission scattering on/off |
|||
float _TexturingModeFlags; // 1 bit/profile; 0 = PreAndPostScatter, 1 = PostScatter |
|||
float _TransmissionFlags; // 1 bit/profile; 0 = regular, 1 = thin |
|||
// Old SSS Model >>> |
|||
float4 _HalfRcpVariancesAndWeights[DIFFUSION_PROFILE_COUNT][2]; // 2x Gaussians in RGB, A is interpolation weights |
|||
// <<< Old SSS Model |
|||
// Use float4 to avoid any packing issue between compute and pixel shaders |
|||
float4 _ThicknessRemaps[DIFFUSION_PROFILE_COUNT]; // R: start, G = end - start, BA unused |
|||
float4 _ShapeParams[DIFFUSION_PROFILE_COUNT]; // RGB = S = 1 / D, A = filter radius |
|||
float4 _TransmissionTintsAndFresnel0[DIFFUSION_PROFILE_COUNT]; // RGB = 1/4 * color, A = fresnel0 |
|||
float4 _WorldScales[DIFFUSION_PROFILE_COUNT]; // X = meters per world unit; Y = world units per meter |
|||
#else |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 63af6347132378d43b75aa5e4efeb029 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:2c14e830338ddf74ff5479bb56e8aa4a4d0f9274e96390d9897d97228f281d8e |
|||
size 54715 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:7502c3fdf5b201b4460a317b577d4e0490e500a6926ba35c53e236afa15ab76a |
|||
size 82906 |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.Graphing; |
|||
using UnityEditor.ShaderGraph.Drawing.Controls; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
|
|||
public enum OutputSpace |
|||
{ |
|||
Tangent, |
|||
World |
|||
}; |
|||
|
|||
[Title("Artistic", "Normal", "Normal From Height")] |
|||
public class NormalFromHeightNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction, IMayRequireTangent, IMayRequireBitangent, IMayRequireNormal, IMayRequirePosition |
|||
{ |
|||
public NormalFromHeightNode() |
|||
{ |
|||
name = "Normal From Height"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-From-Heightmap-Node"; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
private OutputSpace m_OutputSpace = OutputSpace.Tangent; |
|||
|
|||
[EnumControl("Output Space")] |
|||
public OutputSpace outputSpace |
|||
{ |
|||
get { return m_OutputSpace; } |
|||
set |
|||
{ |
|||
if (m_OutputSpace == value) |
|||
return; |
|||
|
|||
m_OutputSpace = value; |
|||
Dirty(ModificationScope.Graph); |
|||
} |
|||
} |
|||
|
|||
const int InputSlotId = 0; |
|||
const int OutputSlotId = 1; |
|||
const string kInputSlotName = "In"; |
|||
const string kOutputSlotName = "Out"; |
|||
|
|||
public override bool hasPreview |
|||
{ |
|||
get { return true; } |
|||
} |
|||
|
|||
string GetFunctionName() |
|||
{ |
|||
return string.Format("Unity_NormalFromHeight_{0}", outputSpace.ToString()); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new Vector1MaterialSlot(InputSlotId, kInputSlotName, kInputSlotName, SlotType.Input, 0)); |
|||
AddSlot(new Vector3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero)); |
|||
RemoveSlotsNameNotMatching(new[] { InputSlotId, OutputSlotId }); |
|||
} |
|||
|
|||
public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var sb = new ShaderStringBuilder(); |
|||
|
|||
var inputValue = GetSlotValue(InputSlotId, generationMode); |
|||
var outputValue = GetSlotValue(OutputSlotId, generationMode); |
|||
sb.AppendLine("{0} {1};", FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType.ToString(precision), GetVariableNameForSlot(OutputSlotId)); |
|||
sb.AppendLine("{0}3x3 _{1}_TangentMatrix = {0}3x3(IN.{2}SpaceTangent, IN.{2}SpaceBiTangent, IN.{2}SpaceNormal);", precision, GetVariableNameForNode(), NeededCoordinateSpace.World.ToString()); |
|||
sb.AppendLine("{0}3 _{1}_Position = IN.{2}SpacePosition;", precision, GetVariableNameForNode(), NeededCoordinateSpace.World.ToString()); |
|||
|
|||
sb.AppendLine("{0}({1},_{2}_Position,_{2}_TangentMatrix, {3});", GetFunctionName(), inputValue, GetVariableNameForNode(), outputValue); |
|||
|
|||
visitor.AddShaderChunk(sb.ToString(), false); |
|||
} |
|||
|
|||
public void GenerateNodeFunction(FunctionRegistry registry, GraphContext graphContext, GenerationMode generationMode) |
|||
{ |
|||
registry.ProvideFunction(GetFunctionName(), s => |
|||
{ |
|||
s.AppendLine("void {0}({2} In, {1}3 Position, {1}3x3 TangentMatrix, out {3} Out)", |
|||
GetFunctionName(), |
|||
precision, |
|||
FindInputSlot<MaterialSlot>(InputSlotId).concreteValueType.ToString(precision), |
|||
FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType.ToString(precision)); |
|||
using (s.BlockScope()) |
|||
{ |
|||
s.AppendLine("{0}3 worldDirivativeX = ddx(Position * 100);", precision); |
|||
s.AppendLine("{0}3 worldDirivativeY = ddy(Position * 100);", precision); |
|||
s.AppendNewLine(); |
|||
s.AppendLine("{0}3 crossX = cross(TangentMatrix[2].xyz, worldDirivativeX);", precision); |
|||
s.AppendLine("{0}3 crossY = cross(TangentMatrix[2].xyz, worldDirivativeY);", precision); |
|||
s.AppendLine("{0}3 d = abs(dot(crossY, worldDirivativeX));", precision); |
|||
s.AppendLine("{0}3 inToNormal = ((((In + ddx(In)) - In) * crossY) + (((In + ddy(In)) - In) * crossX)) * sign(d);", precision); |
|||
s.AppendLine("inToNormal.y *= -1.0;", precision); |
|||
s.AppendNewLine(); |
|||
s.AppendLine("Out = normalize((d * TangentMatrix[2].xyz) - inToNormal);", precision); |
|||
|
|||
if(outputSpace == OutputSpace.Tangent) |
|||
s.AppendLine("Out = TransformWorldToTangent(Out, TangentMatrix);"); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability) |
|||
{ |
|||
return NeededCoordinateSpace.World; |
|||
} |
|||
|
|||
public NeededCoordinateSpace RequiresBitangent(ShaderStageCapability stageCapability) |
|||
{ |
|||
return NeededCoordinateSpace.World; |
|||
} |
|||
|
|||
public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability) |
|||
{ |
|||
return NeededCoordinateSpace.World; |
|||
} |
|||
public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability) |
|||
{ |
|||
return NeededCoordinateSpace.World; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3bf617c1fe220684696e5bf3850bc423 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Reflection; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Title("Artistic", "Normal", "Normal Reconstruct Z")] |
|||
public class NormalReconstructZNode : CodeFunctionNode |
|||
{ |
|||
public NormalReconstructZNode() |
|||
{ |
|||
name = "Normal Reconstruct Z"; |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Reconstruct-Z-Node"; } |
|||
} |
|||
|
|||
protected override MethodInfo GetFunctionToConvert() |
|||
{ |
|||
return GetType().GetMethod("NormalReconstructZ", BindingFlags.Static | BindingFlags.NonPublic); |
|||
} |
|||
|
|||
static string NormalReconstructZ( |
|||
[Slot(0, Binding.None)] Vector2 In, |
|||
[Slot(2, Binding.None, ShaderStageCapability.Fragment)] out Vector3 Out) |
|||
|
|||
{ |
|||
Out = Vector3.zero; |
|||
return |
|||
@"
|
|||
{ |
|||
{precision} reconstructZ = sqrt(1 - ( In.x * In.x + In.y * In.y)); |
|||
{precision}3 normalVector = {precision}3(In.x, In.y, reconstructZ); |
|||
Out = normalize(normalVector); |
|||
}";
|
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 27615ef3e2e760b45b15895bd39d0954 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Linq; |
|||
using UnityEngine; |
|||
using UnityEditor.Graphing; |
|||
using UnityEditor.ShaderGraph.Drawing.Controls; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
|
|||
[Title("Input", "Texture", "Texel Size")] |
|||
public class Texture2DPropertiesNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireMeshUV |
|||
{ |
|||
public const int OutputSlotWId = 0; |
|||
public const int OutputSlotHId = 2; |
|||
public const int TextureInputId = 1; |
|||
const string kOutputSlotWName = "Width"; |
|||
const string kOutputSlotHName = "Height"; |
|||
const string kTextureInputName = "Texture"; |
|||
|
|||
public override bool hasPreview { get { return false; } } |
|||
|
|||
public Texture2DPropertiesNode() |
|||
{ |
|||
name = "Texel Size"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Texel-Size-Node"; } |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotWId, kOutputSlotWName, kOutputSlotWName, SlotType.Output, 0, ShaderStageCapability.Fragment)); |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotHId, kOutputSlotHName, kOutputSlotHName, SlotType.Output, 0, ShaderStageCapability.Fragment)); |
|||
AddSlot(new Texture2DInputMaterialSlot(TextureInputId, kTextureInputName, kTextureInputName)); |
|||
RemoveSlotsNameNotMatching(new[] { OutputSlotWId, OutputSlotHId, TextureInputId }); |
|||
} |
|||
|
|||
// Node generations
|
|||
public virtual void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
visitor.AddShaderChunk(string.Format("{0}2 {1} = {2}_TexelSize.z;", precision, GetVariableNameForSlot(OutputSlotWId), GetSlotValue(TextureInputId, generationMode)), true); |
|||
visitor.AddShaderChunk(string.Format("{0}2 {1} = {2}_TexelSize.w;", precision, GetVariableNameForSlot(OutputSlotHId), GetSlotValue(TextureInputId, generationMode)), true); |
|||
} |
|||
|
|||
public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: ab454fbbbc9f31d4083c178cf885c672 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 24b10579e42f5f845a9f2ab79f921476 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue