浏览代码
Merge pull request #1159 from Unity-Technologies/feature/RefractionModes
Merge pull request #1159 from Unity-Technologies/feature/RefractionModes
Screen Space Refraction Projection Model/main
GitHub
7 年前
当前提交
a2790a45
共有 59 个文件被更改,包括 5943 次插入 和 3296 次删除
-
3CHANGELOG.md
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1102_Unlit_Distortion.unity.png
-
998ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1103_Unlit_Distortion_DepthTest.unity.png
-
998ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1203_Lit_Transparent.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1206_Lit_Transparent_Distortion.unity.png
-
999ImageTemplates/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward.unity.png
-
1ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.Panel.cs
-
3ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUI.cs
-
49ScriptableRenderPipeline/Core/CoreRP/Debugging/MousePositionDebug.cs
-
15ScriptableRenderPipeline/Core/CoreRP/Editor/Debugging/DebugWindow.cs
-
5ScriptableRenderPipeline/Core/CoreRP/Editor/ShaderGenerator/CSharpToHLSL.cs
-
263ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs
-
121ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs.hlsl
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.hlsl
-
84ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader
-
18ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/LightingDebug.cs
-
16ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/LightingDebug.cs.hlsl
-
34ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs
-
39ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
-
12ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDUtils.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
-
157ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.hlsl
-
19ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs
-
15ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.cs.hlsl
-
165ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
-
4ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitTessellation.shader
-
4Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/Materials/PreRefractionPassTester.mat
-
30Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/CommonAssets/SkySettings/HDRP_Default_Sky.asset
-
926Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction.unity
-
5Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_NM.mat
-
6Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_NM_Thickness.mat
-
5Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_Thickness.mat
-
5Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_NM.mat
-
6Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_NM_Thickness.mat
-
5Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_Thickness.mat
-
6Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_HiZ.mat
-
6Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_HiZ.mat
-
16Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward/ComplexMaterial_Flipped/ComplexMaterial_Flipped.mat
-
46Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward/ComplexMaterial_Flipped/Textures/ComplexMat_H.png.meta
-
4Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward/ComplexMaterial_Flipped/Textures/ComplexMat__N.png.meta
-
4Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward/GlassLike.mat
-
3Tests/Scripts/GraphicTests/Framework/TestFrameworkTools.cs
-
42ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs.meta
-
38ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceRefraction.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceRefraction.cs.meta
-
498ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceTracing.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ScreenSpaceTracing.hlsl.meta
-
10Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_HiZ.mat.meta
-
250Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_Proxy.mat
-
10Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_HiZ.mat.meta
-
250Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_Proxy.mat
-
0/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_Proxy.mat.meta
-
0/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Sphere_HiZ.mat
-
0/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_Proxy.mat.meta
-
0/Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction/Lit_Refraction_Plane_HiZ.mat
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1102_Unlit_Distortion.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
998
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1103_Unlit_Distortion_DepthTest.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
998
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1203_Lit_Transparent.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/1xxx_Materials/1206_Lit_Transparent_Distortion.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
999
ImageTemplates/HDRenderPipeline/Scenes/9xxx_Other/9002_Deferred-and-Forward.unity.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
926
Tests/GraphicsTests/RenderPipeline/HDRenderPipeline/Scenes/1xxx_Materials/1205_Lit_Transparent_Refraction.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using System.Collections; |
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEditor.Experimental.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[CanEditMultipleObjects] |
|||
[VolumeComponentEditor(typeof(ScreenSpaceRefraction))] |
|||
public class ScreenSpaceRefractionEditor : VolumeComponentEditor |
|||
{ |
|||
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")); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5b3212fe1b5bb3c4397c9427bb77c207 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[Serializable] |
|||
public class ScreenSpaceRefraction : VolumeComponent |
|||
{ |
|||
static ScreenSpaceRefraction s_Default = null; |
|||
public static ScreenSpaceRefraction @default |
|||
{ |
|||
get |
|||
{ |
|||
if (s_Default == null) |
|||
{ |
|||
s_Default = ScriptableObject.CreateInstance<ScreenSpaceRefraction>(); |
|||
s_Default.hideFlags = HideFlags.HideAndDontSave; |
|||
} |
|||
return s_Default; |
|||
} |
|||
} |
|||
|
|||
public IntParameter rayMinLevel = new IntParameter(2); |
|||
public IntParameter rayMaxLevel = new IntParameter(6); |
|||
public IntParameter rayMaxIterations = new IntParameter(32); |
|||
public FloatParameter rayDepthSuccessBias = new FloatParameter(0.1f); |
|||
public ClampedFloatParameter screenWeightDistance = new ClampedFloatParameter(0.1f, 0, 1); |
|||
|
|||
public void PushShaderParameters(CommandBuffer cmd) |
|||
{ |
|||
cmd.SetGlobalInt(HDShaderIDs._SSRefractionRayMinLevel, rayMinLevel.value); |
|||
cmd.SetGlobalInt(HDShaderIDs._SSRefractionRayMaxLevel, rayMaxLevel.value); |
|||
cmd.SetGlobalInt(HDShaderIDs._SSRefractionRayMaxIterations, rayMaxIterations.value); |
|||
cmd.SetGlobalFloat(HDShaderIDs._SSRefractionRayDepthSuccessBias, rayDepthSuccessBias.value); |
|||
cmd.SetGlobalFloat(HDShaderIDs._SSRefractionInvScreenWeightDistance, 1f / screenWeightDistance.value); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5e17fad69ea181b4483974138b566975 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_SCREEN_SPACE_TRACING_INCLUDED |
|||
#define UNITY_SCREEN_SPACE_TRACING_INCLUDED |
|||
|
|||
// ------------------------------------------------- |
|||
// Algorithm uniform parameters |
|||
// ------------------------------------------------- |
|||
|
|||
const float DepthPlaneBias = 1E-5; |
|||
|
|||
// ------------------------------------------------- |
|||
// Output |
|||
// ------------------------------------------------- |
|||
|
|||
struct ScreenSpaceRayHit |
|||
{ |
|||
uint2 positionSS; // Position of the hit point (SS) |
|||
float2 positionNDC; // Position of the hit point (NDC) |
|||
float linearDepth; // Linear depth of the hit point |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
float3 debugOutput; |
|||
#endif |
|||
}; |
|||
|
|||
struct ScreenSpaceHiZRaymarchInput |
|||
{ |
|||
float3 rayOriginWS; // Ray origin (WS) |
|||
float3 rayDirWS; // Ray direction (WS) |
|||
uint maxIterations; // Number of iterations before failing |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
bool debug; |
|||
#endif |
|||
}; |
|||
|
|||
struct ScreenSpaceProxyRaycastInput |
|||
{ |
|||
float3 rayOriginWS; // Ray origin (WS) |
|||
float3 rayDirWS; // Ray direction (WS) |
|||
EnvLightData proxyData; |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
bool debug; |
|||
#endif |
|||
}; |
|||
|
|||
// ------------------------------------------------- |
|||
// Utilities |
|||
// ------------------------------------------------- |
|||
|
|||
// Calculate the ray origin and direction in SS |
|||
// out positionSS : (x, y, 1/depth) |
|||
// out raySS : (x, y, 1/depth) |
|||
void CalculateRaySS( |
|||
float3 rayOriginWS, |
|||
float3 rayDirWS, |
|||
uint2 bufferSize, |
|||
out float3 positionSS, |
|||
out float3 raySS |
|||
) |
|||
{ |
|||
float3 positionWS = rayOriginWS; |
|||
float3 rayEndWS = rayOriginWS + rayDirWS * 10; |
|||
|
|||
float4 positionCS = ComputeClipSpacePosition(positionWS, GetWorldToHClipMatrix()); |
|||
float4 rayEndCS = ComputeClipSpacePosition(rayEndWS, GetWorldToHClipMatrix()); |
|||
|
|||
float2 positionNDC = ComputeNormalizedDeviceCoordinates(positionWS, GetWorldToHClipMatrix()); |
|||
float2 rayEndNDC = ComputeNormalizedDeviceCoordinates(rayEndWS, GetWorldToHClipMatrix()); |
|||
|
|||
float3 rayStartSS = float3( |
|||
positionNDC.xy * bufferSize, |
|||
1.0 / positionCS.w); // Screen space depth interpolate properly in 1/z |
|||
|
|||
float3 rayEndSS = float3( |
|||
rayEndNDC.xy * bufferSize, |
|||
1.0 / rayEndCS.w); // Screen space depth interpolate properly in 1/z |
|||
|
|||
positionSS = rayStartSS; |
|||
raySS = rayEndSS - rayStartSS; |
|||
} |
|||
|
|||
// Check whether the depth of the ray is above the sampled depth |
|||
// Arguments are inversed linear depth |
|||
bool IsPositionAboveDepth(float rayDepth, float invLinearDepth) |
|||
{ |
|||
// as depth is inverted, we must invert the check as well |
|||
// rayZ > HiZ <=> 1/rayZ < 1/HiZ |
|||
return rayDepth > invLinearDepth; |
|||
} |
|||
|
|||
// Sample the Depth buffer at a specific mip and linear depth |
|||
float LoadDepth(float2 positionSS, int level) |
|||
{ |
|||
float pyramidDepth = LOAD_TEXTURE2D_LOD(_DepthPyramidTexture, int2(positionSS.xy) >> level, level).r; |
|||
float linearDepth = LinearEyeDepth(pyramidDepth, _ZBufferParams); |
|||
return linearDepth; |
|||
} |
|||
|
|||
// Sample the Depth buffer at a specific mip and return 1/linear depth |
|||
float LoadInvDepth(float2 positionSS, int level) |
|||
{ |
|||
float linearDepth = LoadDepth(positionSS, level); |
|||
float invLinearDepth = 1 / linearDepth; |
|||
return invLinearDepth; |
|||
} |
|||
|
|||
bool CellAreEquals(int2 cellA, int2 cellB) |
|||
{ |
|||
return cellA.x == cellB.x && cellA.y == cellB.y; |
|||
} |
|||
|
|||
// Calculate intersection between the ray and the depth plane |
|||
// positionSS.z is 1/depth |
|||
// raySS.z is 1/depth |
|||
float3 IntersectDepthPlane(float3 positionSS, float3 raySS, float invDepth) |
|||
{ |
|||
// The depth of the intersection with the depth plane is: positionSS.z + raySS.z * t = invDepth |
|||
float t = (invDepth - positionSS.z) / raySS.z; |
|||
|
|||
// (t<0) When the ray is going away from the depth plane, |
|||
// put the intersection away. |
|||
// Instead the intersection with the next tile will be used. |
|||
// (t>=0) Add a small distance to go through the depth plane. |
|||
t = t >= 0.0f ? (t + DepthPlaneBias) : 1E5; |
|||
|
|||
// Return the point on the ray |
|||
return positionSS + raySS * t; |
|||
} |
|||
|
|||
// Calculate intersection between a ray and a cell |
|||
float3 IntersectCellPlanes( |
|||
float3 positionSS, |
|||
float3 raySS, |
|||
float2 invRaySS, |
|||
int2 cellId, |
|||
uint2 cellSize, |
|||
int2 cellPlanes, |
|||
float2 crossOffset |
|||
) |
|||
{ |
|||
const float SQRT_2 = sqrt(2); |
|||
const float CellPlaneBias = 1E-2; |
|||
|
|||
// Planes to check |
|||
int2 planes = (cellId + cellPlanes) * cellSize; |
|||
// Hit distance to each planes |
|||
float2 distanceToCellAxes = float2(planes - positionSS.xy) * invRaySS; // (distance to x axis, distance to y axis) |
|||
float t = min(distanceToCellAxes.x, distanceToCellAxes.y) |
|||
// Offset by 1E-3 to ensure cell boundary crossing |
|||
// This assume that length(raySS.xy) == 1; |
|||
+ CellPlaneBias; |
|||
// Interpolate screen space to get next test point |
|||
float3 testHitPositionSS = positionSS + raySS * t; |
|||
|
|||
return testHitPositionSS; |
|||
} |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
// ------------------------------------------------- |
|||
// Debug Utilities |
|||
// ------------------------------------------------- |
|||
|
|||
void DebugComputeCommonOutput( |
|||
float3 rayDirWS, |
|||
bool hitSuccessful, |
|||
inout ScreenSpaceRayHit hit |
|||
) |
|||
{ |
|||
switch (_DebugLightingSubMode) |
|||
{ |
|||
case DEBUGSCREENSPACETRACING_RAY_DIR_WS: |
|||
hit.debugOutput = rayDirWS * 0.5 + 0.5; |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HIT_DEPTH: |
|||
hit.debugOutput = frac(hit.linearDepth * 0.1); |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HIT_SUCCESS: |
|||
hit.debugOutput = hitSuccessful; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
void DebugComputeHiZOutput( |
|||
int iteration, |
|||
float3 startPositionSS, |
|||
float3 rayDirSS, |
|||
int maxIterations, |
|||
int maxUsedLevel, |
|||
int maxMipLevel, |
|||
int intersectionKind, |
|||
inout ScreenSpaceRayHit hit |
|||
) |
|||
{ |
|||
switch (_DebugLightingSubMode) |
|||
{ |
|||
case DEBUGSCREENSPACETRACING_HI_ZPOSITION_NDC: |
|||
hit.debugOutput = float3(float2(startPositionSS.xy) * _ScreenSize.zw, 0); |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HI_ZITERATION_COUNT: |
|||
hit.debugOutput = float(iteration) / float(maxIterations); |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HI_ZRAY_DIR_NDC: |
|||
hit.debugOutput = float3(rayDirSS.xy * 0.5 + 0.5, frac(0.1 / rayDirSS.z)); |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HI_ZMAX_USED_MIP_LEVEL: |
|||
hit.debugOutput = float(maxUsedLevel) / float(maxMipLevel); |
|||
break; |
|||
case DEBUGSCREENSPACETRACING_HI_ZINTERSECTION_KIND: |
|||
hit.debugOutput = GetIndexColor(intersectionKind); |
|||
break; |
|||
} |
|||
} |
|||
#endif |
|||
#endif |
|||
|
|||
// ------------------------------------------------- |
|||
// Algorithm: Proxy raycast |
|||
// ------------------------------------------------- |
|||
|
|||
#ifdef SSRTID |
|||
|
|||
#define SSRT_SETTING(name, SSRTID) _SS ## SSRTID ## name |
|||
#define SSRT_FUNC(name, SSRTID) name ## SSRTID |
|||
|
|||
CBUFFER_START(SSRT_FUNC(UnityScreenSpaceRaymarching, SSRTID)) |
|||
int SSRT_SETTING(RayMinLevel, SSRTID); |
|||
int SSRT_SETTING(RayMaxLevel, SSRTID); |
|||
int SSRT_SETTING(RayMaxIterations, SSRTID); |
|||
float SSRT_SETTING(RayDepthSuccessBias, SSRTID); |
|||
CBUFFER_END |
|||
|
|||
bool SSRT_FUNC(ScreenSpaceProxyRaycast, SSRTID)( |
|||
ScreenSpaceProxyRaycastInput input, |
|||
out ScreenSpaceRayHit hit |
|||
) |
|||
{ |
|||
ZERO_INITIALIZE(ScreenSpaceRayHit, hit); |
|||
|
|||
float3x3 worldToPS = WorldToProxySpace(input.proxyData); |
|||
float3 rayOriginPS = WorldToProxyPosition(input.proxyData, worldToPS, input.rayOriginWS); |
|||
float3 rayDirPS = mul(input.rayDirWS, worldToPS); |
|||
|
|||
float projectionDistance = 0.0; |
|||
|
|||
switch(input.proxyData.influenceShapeType) |
|||
{ |
|||
case ENVSHAPETYPE_SPHERE: |
|||
case ENVSHAPETYPE_SKY: |
|||
{ |
|||
projectionDistance = IntersectSphereProxy(input.proxyData, rayDirPS, rayOriginPS); |
|||
break; |
|||
} |
|||
case ENVSHAPETYPE_BOX: |
|||
projectionDistance = IntersectBoxProxy(input.proxyData, rayDirPS, rayOriginPS); |
|||
break; |
|||
} |
|||
|
|||
float3 hitPositionWS = input.rayOriginWS + input.rayDirWS * projectionDistance; |
|||
float4 hitPositionCS = ComputeClipSpacePosition(hitPositionWS, GetWorldToHClipMatrix()); |
|||
float4 rayOriginCS = ComputeClipSpacePosition(input.rayOriginWS, GetWorldToHClipMatrix()); |
|||
float2 hitPositionNDC = ComputeNormalizedDeviceCoordinates(hitPositionWS, GetWorldToHClipMatrix()); |
|||
uint2 hitPositionSS = uint2(hitPositionNDC *_ScreenSize.xy); |
|||
float hitLinearDepth = hitPositionCS.w; |
|||
|
|||
hit.positionNDC = hitPositionNDC; |
|||
hit.positionSS = hitPositionSS; |
|||
hit.linearDepth = hitLinearDepth; |
|||
|
|||
bool hitSuccessful = true; |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
DebugComputeCommonOutput(input.rayDirWS, hitSuccessful, hit); |
|||
|
|||
if (input.debug) |
|||
{ |
|||
ScreenSpaceTracingDebug debug; |
|||
ZERO_INITIALIZE(ScreenSpaceTracingDebug, debug); |
|||
|
|||
float2 rayOriginNDC = ComputeNormalizedDeviceCoordinates(input.rayOriginWS, GetWorldToHClipMatrix()); |
|||
uint2 rayOriginSS = uint2(rayOriginNDC * _ScreenSize.xy); |
|||
|
|||
debug.tracingModel = REFRACTIONSSRAYMODEL_PROXY; |
|||
debug.loopStartPositionSSX = rayOriginSS.x; |
|||
debug.loopStartPositionSSY = rayOriginSS.y; |
|||
debug.loopStartLinearDepth = rayOriginCS.w; |
|||
debug.endHitSuccess = hitSuccessful; |
|||
debug.endLinearDepth = hitLinearDepth; |
|||
debug.endPositionSSX = hitPositionSS.x; |
|||
debug.endPositionSSY = hitPositionSS.y; |
|||
debug.proxyShapeType = input.proxyData.influenceShapeType; |
|||
debug.projectionDistance = projectionDistance; |
|||
|
|||
_DebugScreenSpaceTracingData[0] = debug; |
|||
} |
|||
#endif |
|||
|
|||
return hitSuccessful; |
|||
} |
|||
|
|||
// ------------------------------------------------- |
|||
// Algorithm: HiZ raymarching |
|||
// ------------------------------------------------- |
|||
|
|||
// Based on Yasin Uludag, 2014. "Hi-Z Screen-Space Cone-Traced Reflections", GPU Pro5: Advanced Rendering Techniques |
|||
|
|||
bool SSRT_FUNC(ScreenSpaceHiZRaymarch, SSRTID)( |
|||
ScreenSpaceHiZRaymarchInput input, |
|||
out ScreenSpaceRayHit hit |
|||
) |
|||
{ |
|||
const float2 CROSS_OFFSET = float2(1, 1); |
|||
|
|||
// Initialize loop |
|||
ZERO_INITIALIZE(ScreenSpaceRayHit, hit); |
|||
bool hitSuccessful = true; |
|||
uint iteration = 0u; |
|||
int minMipLevel = max(SSRT_SETTING(RayMinLevel, SSRTID), 0); |
|||
int maxMipLevel = min(SSRT_SETTING(RayMaxLevel, SSRTID), int(_DepthPyramidScale.z)); |
|||
uint2 bufferSize = uint2(_DepthPyramidSize.xy); |
|||
uint maxIterations = min(input.maxIterations, SSRT_SETTING(RayMaxIterations, SSRTID)); |
|||
|
|||
float3 startPositionSS; |
|||
float3 raySS; |
|||
CalculateRaySS( |
|||
input.rayOriginWS, |
|||
input.rayDirWS, |
|||
bufferSize, |
|||
startPositionSS, |
|||
raySS |
|||
); |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
// Initialize debug variables |
|||
int debugLoopMipMaxUsedLevel = minMipLevel; |
|||
int debugIterationMipLevel = minMipLevel; |
|||
uint2 debugIterationCellSize = uint2(0u, 0u); |
|||
float3 debugIterationPositionSS = float3(0, 0, 0); |
|||
uint debugIteration = 0u; |
|||
uint debugIterationIntersectionKind = 0u; |
|||
float debugIterationLinearDepthBuffer = 0; |
|||
#endif |
|||
|
|||
int intersectionKind = 0; |
|||
float raySSLength = length(raySS.xy); |
|||
raySS /= raySSLength; |
|||
// Initialize raymarching |
|||
float2 invRaySS = float2(1, 1) / raySS.xy; |
|||
|
|||
// Calculate planes to intersect for each cell |
|||
int2 cellPlanes = sign(raySS.xy); |
|||
float2 crossOffset = CROSS_OFFSET * cellPlanes; |
|||
cellPlanes = clamp(cellPlanes, 0, 1); |
|||
|
|||
int currentLevel = minMipLevel; |
|||
uint2 cellCount = bufferSize >> currentLevel; |
|||
uint2 cellSize = uint2(1, 1) << currentLevel; |
|||
|
|||
float3 positionSS = startPositionSS; |
|||
float invHiZDepth = 0; |
|||
|
|||
while (currentLevel >= minMipLevel) |
|||
{ |
|||
if (iteration >= maxIterations) |
|||
{ |
|||
hitSuccessful = false; |
|||
break; |
|||
} |
|||
|
|||
cellCount = bufferSize >> currentLevel; |
|||
cellSize = uint2(1, 1) << currentLevel; |
|||
|
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
// Fetch pre iteration debug values |
|||
if (input.debug && _DebugStep >= iteration) |
|||
debugIterationMipLevel = currentLevel; |
|||
#endif |
|||
|
|||
// Go down in HiZ levels by default |
|||
int mipLevelDelta = -1; |
|||
|
|||
// Sampled as 1/Z so it interpolate properly in screen space. |
|||
invHiZDepth = LoadInvDepth(positionSS.xy, currentLevel); |
|||
intersectionKind = HIZINTERSECTIONKIND_NONE; |
|||
|
|||
if (IsPositionAboveDepth(positionSS.z, invHiZDepth)) |
|||
{ |
|||
float3 candidatePositionSS = IntersectDepthPlane(positionSS, raySS, invHiZDepth); |
|||
|
|||
intersectionKind = HIZINTERSECTIONKIND_DEPTH; |
|||
|
|||
const int2 cellId = int2(positionSS.xy) / cellSize; |
|||
const int2 candidateCellId = int2(candidatePositionSS.xy) / cellSize; |
|||
|
|||
// If we crossed the current cell |
|||
if (!CellAreEquals(cellId, candidateCellId)) |
|||
{ |
|||
candidatePositionSS = IntersectCellPlanes( |
|||
positionSS, |
|||
raySS, |
|||
invRaySS, |
|||
cellId, |
|||
cellSize, |
|||
cellPlanes, |
|||
crossOffset); |
|||
|
|||
intersectionKind = HIZINTERSECTIONKIND_CELL; |
|||
|
|||
// Go up a level to go faster |
|||
mipLevelDelta = 1; |
|||
} |
|||
|
|||
positionSS = candidatePositionSS; |
|||
} |
|||
|
|||
currentLevel = min(currentLevel + mipLevelDelta, maxMipLevel); |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
// Fetch post iteration debug values |
|||
if (input.debug && _DebugStep >= iteration) |
|||
{ |
|||
debugLoopMipMaxUsedLevel = max(debugLoopMipMaxUsedLevel, currentLevel); |
|||
debugIterationPositionSS = positionSS; |
|||
debugIterationLinearDepthBuffer = 1 / invHiZDepth; |
|||
debugIteration = iteration; |
|||
debugIterationIntersectionKind = intersectionKind; |
|||
debugIterationCellSize = cellSize; |
|||
} |
|||
#endif |
|||
|
|||
// Check if we are out of the buffer |
|||
if (any(int2(positionSS.xy) > int2(bufferSize)) |
|||
|| any(positionSS.xy < 0) |
|||
) |
|||
{ |
|||
hitSuccessful = false; |
|||
break; |
|||
} |
|||
|
|||
++iteration; |
|||
} |
|||
|
|||
hit.linearDepth = 1 / positionSS.z; |
|||
hit.positionNDC = float2(positionSS.xy) / float2(bufferSize); |
|||
hit.positionSS = uint2(positionSS.xy); |
|||
|
|||
if (hit.linearDepth > (1 / invHiZDepth) + SSRT_SETTING(RayDepthSuccessBias, SSRTID)) |
|||
hitSuccessful = false; |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
DebugComputeCommonOutput(input.rayDirWS, hitSuccessful, hit); |
|||
DebugComputeHiZOutput( |
|||
iteration, |
|||
startPositionSS, |
|||
raySS, |
|||
SSRT_SETTING(RayMaxIterations, SSRTID), |
|||
debugLoopMipMaxUsedLevel, |
|||
maxMipLevel, |
|||
intersectionKind, |
|||
hit |
|||
); |
|||
|
|||
if (input.debug) |
|||
{ |
|||
// Build debug structure |
|||
ScreenSpaceTracingDebug debug; |
|||
ZERO_INITIALIZE(ScreenSpaceTracingDebug, debug); |
|||
|
|||
debug.tracingModel = REFRACTIONSSRAYMODEL_HI_Z; |
|||
debug.loopStartPositionSSX = uint(startPositionSS.x); |
|||
debug.loopStartPositionSSY = uint(startPositionSS.y); |
|||
debug.loopStartLinearDepth = 1 / startPositionSS.z; |
|||
debug.loopRayDirectionSS = raySS; |
|||
debug.loopMipLevelMax = debugLoopMipMaxUsedLevel; |
|||
debug.loopIterationMax = iteration; |
|||
debug.iterationPositionSS = debugIterationPositionSS; |
|||
debug.iterationMipLevel = debugIterationMipLevel; |
|||
debug.iteration = debugIteration; |
|||
debug.iterationLinearDepthBuffer = debugIterationLinearDepthBuffer; |
|||
debug.iterationIntersectionKind = debugIterationIntersectionKind; |
|||
debug.iterationCellSizeW = debugIterationCellSize.x; |
|||
debug.iterationCellSizeH = debugIterationCellSize.y; |
|||
debug.endHitSuccess = hitSuccessful; |
|||
debug.endLinearDepth = hit.linearDepth; |
|||
debug.endPositionSSX = hit.positionSS.x; |
|||
debug.endPositionSSY = hit.positionSS.y; |
|||
|
|||
_DebugScreenSpaceTracingData[0] = debug; |
|||
} |
|||
#endif |
|||
|
|||
return hitSuccessful; |
|||
} |
|||
|
|||
#undef SSRT_SETTING |
|||
#undef SSRT_FUNC |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: aee64cd8304a9fa46a29f5533aa77b29 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: a674d63420e0d5c4091de0387c17c3b3 |
|||
timeCreated: 1509349727 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: Lit_Refraction_Plane_Proxy |
|||
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} |
|||
m_ShaderKeywords: _BLENDMODE_ALPHA _BLENDMODE_PRESERVE_SPECULAR_LIGHTING _ENABLE_FOG_ON_TRANSPARENT |
|||
_NORMALMAP_TANGENT_SPACE _REFRACTION_PLANE _REFRACTION_SSRAY_PROXY _SURFACE_TYPE_TRANSPARENT |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: 3000 |
|||
stringTagMap: |
|||
RenderType: Transparent |
|||
disabledShaderPasses: |
|||
- DistortionVectors |
|||
- TransparentBackfaceDebugDisplay |
|||
- TransparentDepthPrepass |
|||
- TransparentDepthPostpass |
|||
- TransparentBackface |
|||
- MOTIONVECTORS |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _AnisotropyMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _CoatMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DistortionVectorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissiveColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _HeightMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _IridescenceMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _IridescenceThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecularColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceRadiusMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMapIridescence: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TransmittanceColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AORemapMax: 1 |
|||
- _AORemapMin: 0 |
|||
- _ATDistance: 1 |
|||
- _AlbedoAffectEmissive: 0 |
|||
- _AlphaCutoff: 0.5 |
|||
- _AlphaCutoffEnable: 0 |
|||
- _AlphaCutoffPostpass: 0.5 |
|||
- _AlphaCutoffPrepass: 0.5 |
|||
- _Anisotropy: 0 |
|||
- _BlendMode: 0 |
|||
- _CoatCoverage: 1 |
|||
- _CoatIOR: 0.5 |
|||
- _CoatMask: 0 |
|||
- _CullMode: 2 |
|||
- _CullModeForward: 2 |
|||
- _Cutoff: 0.5 |
|||
- _DepthOffsetEnable: 0 |
|||
- _DetailAlbedoScale: 1 |
|||
- _DetailNormalScale: 1 |
|||
- _DetailSmoothnessScale: 1 |
|||
- _DiffusionProfile: 0 |
|||
- _DisplacementLockObjectScale: 1 |
|||
- _DisplacementLockTilingScale: 1 |
|||
- _DisplacementMode: 0 |
|||
- _DistortionBlendMode: 0 |
|||
- _DistortionBlurBlendMode: 0 |
|||
- _DistortionBlurDstBlend: 1 |
|||
- _DistortionBlurRemapMax: 1 |
|||
- _DistortionBlurRemapMin: 0 |
|||
- _DistortionBlurScale: 1 |
|||
- _DistortionBlurSrcBlend: 1 |
|||
- _DistortionDepthTest: 0 |
|||
- _DistortionDstBlend: 1 |
|||
- _DistortionEnable: 0 |
|||
- _DistortionScale: 1 |
|||
- _DistortionSrcBlend: 1 |
|||
- _DistortionVectorBias: -1 |
|||
- _DistortionVectorScale: 2 |
|||
- _DoubleSidedEnable: 0 |
|||
- _DoubleSidedNormalMode: 1 |
|||
- _Drag: 1 |
|||
- _DstBlend: 10 |
|||
- _EmissiveColorMode: 1 |
|||
- _EmissiveIntensity: 0 |
|||
- _EnableBlendModePreserveSpecularLighting: 1 |
|||
- _EnableFogOnTransparent: 1 |
|||
- _EnableMotionVectorForVertexAnimation: 0 |
|||
- _EnableSpecularOcclusion: 0 |
|||
- _EnableWind: 0 |
|||
- _EnergyConservingSpecularColor: 1 |
|||
- _HeightAmplitude: 0.099999994 |
|||
- _HeightCenter: 0.5 |
|||
- _HeightMapParametrization: 1 |
|||
- _HeightMax: 5 |
|||
- _HeightMin: -5 |
|||
- _HeightOffset: 0 |
|||
- _HeightPoMAmplitude: 10 |
|||
- _HeightTessAmplitude: 10 |
|||
- _HeightTessCenter: 0.5 |
|||
- _IOR: 1.5 |
|||
- _InitialBend: 1 |
|||
- _InvTilingScale: 1 |
|||
- _Ior: 1.5 |
|||
- _IridescenceMask: 1 |
|||
- _IridescenceThickness: 1 |
|||
- _LinkDetailsWithBase: 1 |
|||
- _MaterialID: 1 |
|||
- _Metallic: 0 |
|||
- _NormalMapSpace: 0 |
|||
- _NormalScale: 1 |
|||
- _PPDLodThreshold: 5 |
|||
- _PPDMaxSamples: 15 |
|||
- _PPDMinSamples: 5 |
|||
- _PPDPrimitiveLength: 1 |
|||
- _PPDPrimitiveWidth: 1 |
|||
- _PreRefractionPass: 0 |
|||
- _RefractionMode: 1 |
|||
- _RefractionModel: 1 |
|||
- _RefractionSSRayModel: 1 |
|||
- _SSSAndTransmissionType: 0 |
|||
- _ShiverDirectionality: 0.5 |
|||
- _ShiverDrag: 0.2 |
|||
- _Smoothness: 1 |
|||
- _SmoothnessRemapMax: 1 |
|||
- _SmoothnessRemapMin: 0 |
|||
- _SrcBlend: 1 |
|||
- _StencilRef: 2 |
|||
- _StencilRefMV: 128 |
|||
- _StencilWriteMask: 7 |
|||
- _StencilWriteMaskMV: 128 |
|||
- _Stiffness: 1 |
|||
- _SubsurfaceMask: 1 |
|||
- _SubsurfaceProfile: 0 |
|||
- _SubsurfaceRadius: 1 |
|||
- _SupportDBuffer: 1 |
|||
- _SurfaceType: 1 |
|||
- _TexWorldScale: 1 |
|||
- _TexWorldScaleEmissive: 1 |
|||
- _Thickness: 1 |
|||
- _ThicknessIridescence: 1 |
|||
- _ThicknessMultiplier: 2 |
|||
- _TransmissionEnable: 1 |
|||
- _TransparentBackfaceEnable: 0 |
|||
- _TransparentDepthPostpassEnable: 0 |
|||
- _TransparentDepthPrepassEnable: 0 |
|||
- _TransparentSortPriority: 0 |
|||
- _UVBase: 0 |
|||
- _UVDetail: 0 |
|||
- _UVEmissive: 0 |
|||
- _ZTestDepthEqualForOpaque: 4 |
|||
- _ZTestGBuffer: 4 |
|||
- _ZTestMode: 8 |
|||
- _ZTestModeDistortion: 8 |
|||
- _ZWrite: 0 |
|||
m_Colors: |
|||
- _BaseColor: {r: 1, g: 1, b: 1, a: 0} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 0} |
|||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} |
|||
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} |
|||
- _ThicknessRemapIridescence: {r: 0, g: 1, b: 0, a: 0} |
|||
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 673e03d5b17ddb8488587a4d090626c0 |
|||
timeCreated: 1509349727 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_Name: Lit_Refraction_Sphere_Proxy |
|||
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} |
|||
m_ShaderKeywords: _BLENDMODE_ALPHA _BLENDMODE_PRESERVE_SPECULAR_LIGHTING _ENABLE_FOG_ON_TRANSPARENT |
|||
_NORMALMAP_TANGENT_SPACE _REFRACTION_SPHERE _REFRACTION_SSRAY_PROXY _SURFACE_TYPE_TRANSPARENT |
|||
m_LightmapFlags: 4 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: 3000 |
|||
stringTagMap: |
|||
RenderType: Transparent |
|||
disabledShaderPasses: |
|||
- DistortionVectors |
|||
- TransparentBackfaceDebugDisplay |
|||
- TransparentDepthPrepass |
|||
- TransparentDepthPostpass |
|||
- TransparentBackface |
|||
- MOTIONVECTORS |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- _AnisotropyMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BentNormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _CoatMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DetailMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _DistortionVectorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissiveColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _HeightMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _IridescenceMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _IridescenceThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _NormalMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecularColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceMaskMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SubsurfaceRadiusMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TangentMapOS: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _ThicknessMapIridescence: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _TransmittanceColorMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- _AORemapMax: 1 |
|||
- _AORemapMin: 0 |
|||
- _ATDistance: 1 |
|||
- _AlbedoAffectEmissive: 0 |
|||
- _AlphaCutoff: 0.5 |
|||
- _AlphaCutoffEnable: 0 |
|||
- _AlphaCutoffPostpass: 0.5 |
|||
- _AlphaCutoffPrepass: 0.5 |
|||
- _Anisotropy: 0 |
|||
- _BlendMode: 0 |
|||
- _CoatCoverage: 1 |
|||
- _CoatIOR: 0.5 |
|||
- _CoatMask: 0 |
|||
- _CullMode: 2 |
|||
- _CullModeForward: 2 |
|||
- _Cutoff: 0.5 |
|||
- _DepthOffsetEnable: 0 |
|||
- _DetailAlbedoScale: 1 |
|||
- _DetailNormalScale: 1 |
|||
- _DetailSmoothnessScale: 1 |
|||
- _DiffusionProfile: 0 |
|||
- _DisplacementLockObjectScale: 1 |
|||
- _DisplacementLockTilingScale: 1 |
|||
- _DisplacementMode: 0 |
|||
- _DistortionBlendMode: 0 |
|||
- _DistortionBlurBlendMode: 0 |
|||
- _DistortionBlurDstBlend: 1 |
|||
- _DistortionBlurRemapMax: 1 |
|||
- _DistortionBlurRemapMin: 0 |
|||
- _DistortionBlurScale: 1 |
|||
- _DistortionBlurSrcBlend: 1 |
|||
- _DistortionDepthTest: 0 |
|||
- _DistortionDstBlend: 1 |
|||
- _DistortionEnable: 0 |
|||
- _DistortionScale: 1 |
|||
- _DistortionSrcBlend: 1 |
|||
- _DistortionVectorBias: -1 |
|||
- _DistortionVectorScale: 2 |
|||
- _DoubleSidedEnable: 0 |
|||
- _DoubleSidedNormalMode: 1 |
|||
- _Drag: 1 |
|||
- _DstBlend: 10 |
|||
- _EmissiveColorMode: 1 |
|||
- _EmissiveIntensity: 0 |
|||
- _EnableBlendModePreserveSpecularLighting: 1 |
|||
- _EnableFogOnTransparent: 1 |
|||
- _EnableMotionVectorForVertexAnimation: 0 |
|||
- _EnableSpecularOcclusion: 0 |
|||
- _EnableWind: 0 |
|||
- _EnergyConservingSpecularColor: 1 |
|||
- _HeightAmplitude: 0.099999994 |
|||
- _HeightCenter: 0.5 |
|||
- _HeightMapParametrization: 1 |
|||
- _HeightMax: 5 |
|||
- _HeightMin: -5 |
|||
- _HeightOffset: 0 |
|||
- _HeightPoMAmplitude: 10 |
|||
- _HeightTessAmplitude: 10 |
|||
- _HeightTessCenter: 0.5 |
|||
- _IOR: 1.5 |
|||
- _InitialBend: 1 |
|||
- _InvTilingScale: 1 |
|||
- _Ior: 1.5 |
|||
- _IridescenceMask: 1 |
|||
- _IridescenceThickness: 1 |
|||
- _LinkDetailsWithBase: 1 |
|||
- _MaterialID: 1 |
|||
- _Metallic: 0 |
|||
- _NormalMapSpace: 0 |
|||
- _NormalScale: 1 |
|||
- _PPDLodThreshold: 5 |
|||
- _PPDMaxSamples: 15 |
|||
- _PPDMinSamples: 5 |
|||
- _PPDPrimitiveLength: 1 |
|||
- _PPDPrimitiveWidth: 1 |
|||
- _PreRefractionPass: 0 |
|||
- _RefractionMode: 2 |
|||
- _RefractionModel: 2 |
|||
- _RefractionSSRayModel: 1 |
|||
- _SSSAndTransmissionType: 0 |
|||
- _ShiverDirectionality: 0.5 |
|||
- _ShiverDrag: 0.2 |
|||
- _Smoothness: 1 |
|||
- _SmoothnessRemapMax: 1 |
|||
- _SmoothnessRemapMin: 0 |
|||
- _SrcBlend: 1 |
|||
- _StencilRef: 2 |
|||
- _StencilRefMV: 128 |
|||
- _StencilWriteMask: 7 |
|||
- _StencilWriteMaskMV: 128 |
|||
- _Stiffness: 1 |
|||
- _SubsurfaceMask: 1 |
|||
- _SubsurfaceProfile: 0 |
|||
- _SubsurfaceRadius: 1 |
|||
- _SupportDBuffer: 1 |
|||
- _SurfaceType: 1 |
|||
- _TexWorldScale: 1 |
|||
- _TexWorldScaleEmissive: 1 |
|||
- _Thickness: 1 |
|||
- _ThicknessIridescence: 1 |
|||
- _ThicknessMultiplier: 2 |
|||
- _TransmissionEnable: 1 |
|||
- _TransparentBackfaceEnable: 0 |
|||
- _TransparentDepthPostpassEnable: 0 |
|||
- _TransparentDepthPrepassEnable: 0 |
|||
- _TransparentSortPriority: 0 |
|||
- _UVBase: 0 |
|||
- _UVDetail: 0 |
|||
- _UVEmissive: 0 |
|||
- _ZTestDepthEqualForOpaque: 4 |
|||
- _ZTestGBuffer: 4 |
|||
- _ZTestMode: 8 |
|||
- _ZTestModeDistortion: 8 |
|||
- _ZWrite: 0 |
|||
m_Colors: |
|||
- _BaseColor: {r: 1, g: 1, b: 1, a: 0} |
|||
- _Color: {r: 1, g: 1, b: 1, a: 0} |
|||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} |
|||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} |
|||
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} |
|||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} |
|||
- _ThicknessRemapIridescence: {r: 0, g: 1, b: 0, a: 0} |
|||
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} |
|||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} |
|||
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} |
撰写
预览
正在加载...
取消
保存
Reference in new issue