Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
timchen1002
CustomSRP_06_ShadowMasks
提交
c4e702b9
C
CustomSRP_06_ShadowMasks
项目概览
timchen1002
/
CustomSRP_06_ShadowMasks
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
CustomSRP_06_ShadowMasks
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c4e702b9
编写于
9月 14, 2021
作者:
timchen1002
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
f25931c4
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
7109 addition
and
1166 deletion
+7109
-1166
Assets/Custom_RP.asset
Assets/Custom_RP.asset
+1
-1
Assets/RawAssets/Lit Clip.mat
Assets/RawAssets/Lit Clip.mat
+4
-4
Assets/RawAssets/Lit Opague Baked Emissive.mat
Assets/RawAssets/Lit Opague Baked Emissive.mat
+1
-1
Assets/RawAssets/Lit Opague.mat
Assets/RawAssets/Lit Opague.mat
+2
-2
Assets/RawAssets/Lit Transparent.mat
Assets/RawAssets/Lit Transparent.mat
+3
-2
Assets/Scenes/Baked Light.unity
Assets/Scenes/Baked Light.unity
+6967
-1124
Assets/Scenes/Baked Light/LightingData.asset
Assets/Scenes/Baked Light/LightingData.asset
+0
-0
Assets/Scenes/Baked Light/Lightmap-0_comp_light.exr
Assets/Scenes/Baked Light/Lightmap-0_comp_light.exr
+0
-0
Assets/Scenes/Baked Light/Lightmap-0_comp_shadowmask.png
Assets/Scenes/Baked Light/Lightmap-0_comp_shadowmask.png
+0
-0
Assets/Scenes/Baked Light/ReflectionProbe-0.exr
Assets/Scenes/Baked Light/ReflectionProbe-0.exr
+0
-0
Assets/Scenes/Baked LightSettings.lighting
Assets/Scenes/Baked LightSettings.lighting
+1
-1
Assets/Scripts/Examples/MeshBall.cs
Assets/Scripts/Examples/MeshBall.cs
+3
-1
Assets/Scripts/Runtime/CameraRenderer.cs
Assets/Scripts/Runtime/CameraRenderer.cs
+1
-1
Assets/Scripts/Runtime/Shadows.cs
Assets/Scripts/Runtime/Shadows.cs
+14
-6
Assets/ShaderLibrary/Common.hlsl
Assets/ShaderLibrary/Common.hlsl
+4
-0
Assets/ShaderLibrary/GI.hlsl
Assets/ShaderLibrary/GI.hlsl
+24
-4
Assets/ShaderLibrary/Light.hlsl
Assets/ShaderLibrary/Light.hlsl
+2
-1
Assets/ShaderLibrary/Lighting.hlsl
Assets/ShaderLibrary/Lighting.hlsl
+0
-1
Assets/ShaderLibrary/Shadows.hlsl
Assets/ShaderLibrary/Shadows.hlsl
+67
-10
Assets/ShaderLibrary/UnityInput.hlsl
Assets/ShaderLibrary/UnityInput.hlsl
+2
-0
Assets/Shaders/Lit.shader
Assets/Shaders/Lit.shader
+1
-1
ProjectSettings/QualitySettings.asset
ProjectSettings/QualitySettings.asset
+12
-6
未找到文件。
Assets/Custom_RP.asset
浏览文件 @
c4e702b9
...
...
@@ -16,7 +16,7 @@ MonoBehaviour:
useGPUInstancing
:
1
useSRPBatcher
:
1
shadows
:
maxDistance
:
1
2.0
6
maxDistance
:
16
distanceFade
:
0.1
directional
:
atlasSize
:
4096
...
...
Assets/RawAssets/Lit Clip.mat
浏览文件 @
c4e702b9
...
...
@@ -9,7 +9,7 @@ Material:
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Lit Clip
m_Shader
:
{
fileID
:
4800000
,
guid
:
6848ac66b88696c4ea2f1389e0877b8e
,
type
:
3
}
m_ShaderKeywords
:
_CLIPPING _RECEIVE_SHADOWS _SHADOWS_
CLIP
m_ShaderKeywords
:
_CLIPPING _RECEIVE_SHADOWS _SHADOWS_
DITHER
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
1
m_DoubleSidedGI
:
0
...
...
@@ -44,7 +44,7 @@ Material:
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Texture
:
{
fileID
:
2800000
,
guid
:
5c8805d759cc642b5845cd761592c0c0
,
type
:
3
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
...
...
@@ -76,7 +76,7 @@ Material:
-
_PremulAlpha
:
0
-
_PremulAlphax
:
0
-
_ReceiveShadows
:
1
-
_Shadows
:
1
-
_Shadows
:
2
-
_Smoothness
:
0.5
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
...
...
@@ -85,6 +85,6 @@ Material:
-
_ZWrite
:
1
m_Colors
:
-
_BaseColor
:
{
r
:
0.5
,
g
:
0.5
,
b
:
0.5
,
a
:
1
}
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_Color
:
{
r
:
0.9647059
,
g
:
0.7058823
,
b
:
0.9921569
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
m_BuildTextureStacks
:
[]
Assets/RawAssets/Lit Opague Baked Emissive.mat
浏览文件 @
c4e702b9
...
...
@@ -85,5 +85,5 @@ Material:
m_Colors
:
-
_BaseColor
:
{
r
:
0.5019608
,
g
:
0.5019608
,
b
:
0.5019608
,
a
:
1
}
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
1
,
b
:
1
,
a
:
1
}
m_BuildTextureStacks
:
[]
Assets/RawAssets/Lit Opague.mat
浏览文件 @
c4e702b9
...
...
@@ -83,7 +83,7 @@ Material:
-
_UVSec
:
0
-
_ZWrite
:
1
m_Colors
:
-
_BaseColor
:
{
r
:
0.
14901961
,
g
:
0.76470596
,
b
:
0.1529411
8
,
a
:
1
}
-
_Color
:
{
r
:
0.
14901961
,
g
:
0.76470596
,
b
:
0.1529411
8
,
a
:
1
}
-
_BaseColor
:
{
r
:
0.
5019608
,
g
:
0.5019608
,
b
:
0.501960
8
,
a
:
1
}
-
_Color
:
{
r
:
0.
5019608
,
g
:
0.5019608
,
b
:
0.501960
8
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
m_BuildTextureStacks
:
[]
Assets/RawAssets/Lit Transparent.mat
浏览文件 @
c4e702b9
...
...
@@ -44,7 +44,7 @@ Material:
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Texture
:
{
fileID
:
2800000
,
guid
:
5c8805d759cc642b5845cd761592c0c0
,
type
:
3
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
...
...
@@ -75,6 +75,7 @@ Material:
-
_Parallax
:
0.02
-
_PremulAlpha
:
1
-
_PremulAlphax
:
0
-
_ReceiveShadows
:
1
-
_Shadows
:
2
-
_Smoothness
:
0.5
-
_SmoothnessTextureChannel
:
0
...
...
@@ -84,6 +85,6 @@ Material:
-
_ZWrite
:
0
m_Colors
:
-
_BaseColor
:
{
r
:
0.5
,
g
:
0.5
,
b
:
0.5
,
a
:
1
}
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_Color
:
{
r
:
0.7294118
,
g
:
0.8588236
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
m_BuildTextureStacks
:
[]
Assets/Scenes/Baked Light.unity
浏览文件 @
c4e702b9
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
Assets/Scenes/Baked Light/LightingData.asset
浏览文件 @
c4e702b9
无法预览此类型文件
Assets/Scenes/Baked Light/Lightmap-0_comp_light.exr
浏览文件 @
c4e702b9
无法预览此类型文件
Assets/Scenes/Baked Light/Lightmap-0_comp_shadowmask.png
查看替换文件 @
f25931c4
浏览文件 @
c4e702b9
19.8 KB
|
W:
|
H:
28.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Assets/Scenes/Baked Light/ReflectionProbe-0.exr
浏览文件 @
c4e702b9
无法预览此类型文件
Assets/Scenes/Baked LightSettings.lighting
浏览文件 @
c4e702b9
...
...
@@ -47,7 +47,7 @@ LightingSettings:
m_LightProbeSampleCountMultiplier
:
4
m_PVRBounces
:
2
m_PVRMinBounces
:
2
m_PVREnvironmentMIS
:
1
m_PVREnvironmentMIS
:
0
m_PVRFilteringMode
:
2
m_PVRDenoiserTypeDirect
:
0
m_PVRDenoiserTypeIndirect
:
0
...
...
Assets/Scripts/Examples/MeshBall.cs
浏览文件 @
c4e702b9
...
...
@@ -67,10 +67,12 @@ public class MeshBall : MonoBehaviour
positions
[
i
]
=
matrices
[
i
].
GetColumn
(
3
);
}
var
lightProbes
=
new
SphericalHarmonicsL2
[
1023
];
var
occlusionProbes
=
new
Vector4
[
1023
];
LightProbes
.
CalculateInterpolatedLightAndOcclusionProbes
(
positions
,
lightProbes
,
null
positions
,
lightProbes
,
occlusionProbes
);
block
.
CopySHCoefficientArraysFrom
(
lightProbes
);
block
.
CopyProbeOcclusionArrayFrom
(
occlusionProbes
);
}
}
// 绘制网格实例
...
...
Assets/Scripts/Runtime/CameraRenderer.cs
浏览文件 @
c4e702b9
...
...
@@ -129,7 +129,7 @@ public partial class CameraRenderer
{
enableDynamicBatching
=
useDynamicBatching
,
enableInstancing
=
useGPUInstancing
,
perObjectData
=
PerObjectData
.
Lightmaps
|
PerObjectData
.
ShadowMask
|
PerObjectData
.
LightProbe
|
PerObjectData
.
LightProbeProxyVolume
,
perObjectData
=
PerObjectData
.
Lightmaps
|
PerObjectData
.
ShadowMask
|
PerObjectData
.
LightProbe
|
PerObjectData
.
OcclusionProbe
|
PerObjectData
.
LightProbeProxyVolume
,
};
// 渲染CustomLit表示的pass块
drawingSettings
.
SetShaderPassName
(
1
,
litShaderTagId
);
...
...
Assets/Scripts/Runtime/Shadows.cs
浏览文件 @
c4e702b9
...
...
@@ -69,7 +69,8 @@ public class Shadows
};
static
string
[]
shadowMaskKeywords
=
{
"_SHADOW_MASK_DISTANCE"
"_SHADOW_MASK_ALWAYS"
,
"_SHADOW_MASK_DISTANCE"
,
};
public
void
Setup
(
ScriptableRenderContext
context
,
CullingResults
cullingResults
,
ShadowSettings
shadowSettings
)
...
...
@@ -96,28 +97,35 @@ public class Shadows
/// <param name="light"></param>
/// <param name="visibleLightIndex"></param>
/// <returns></returns>
public
Vector
3
ReserveDirectionalShadows
(
Light
light
,
int
visibleLightIndex
)
public
Vector
4
ReserveDirectionalShadows
(
Light
light
,
int
visibleLightIndex
)
{
if
(
shadowedDirectionalLightCount
<
maxShadowedDirLightCount
&&
light
.
shadows
!=
LightShadows
.
None
&&
light
.
shadowStrength
>
0f
&&
cullingResults
.
GetShadowCasterBounds
(
visibleLightIndex
,
out
Bounds
b
)
)
if
(
shadowedDirectionalLightCount
<
maxShadowedDirLightCount
&&
light
.
shadows
!=
LightShadows
.
None
&&
light
.
shadowStrength
>
0f
)
{
float
maskChannel
=
-
1
;
// 如果使用了ShadowMask
LightBakingOutput
lightBaking
=
light
.
bakingOutput
;
if
(
lightBaking
.
lightmapBakeType
==
LightmapBakeType
.
Mixed
&&
lightBaking
.
mixedLightingMode
==
MixedLightingMode
.
Shadowmask
)
{
useShadowMask
=
true
;
maskChannel
=
lightBaking
.
occlusionMaskChannel
;
}
if
(!
cullingResults
.
GetShadowCasterBounds
(
visibleLightIndex
,
out
Bounds
b
))
{
return
new
Vector4
(-
light
.
shadowStrength
,
0f
,
0f
,
maskChannel
);
}
shadowedDirectionalLights
[
shadowedDirectionalLightCount
]
=
new
ShadowedDirectionalLight
{
visibleLightIndex
=
visibleLightIndex
,
slopeScaleBias
=
light
.
shadowBias
,
nearPlaneOffset
=
light
.
shadowNearPlane
};
return
new
Vector
3
(
return
new
Vector
4
(
light
.
shadowStrength
,
shadowSettings
.
directional
.
cascadeCount
*
shadowedDirectionalLightCount
++,
light
.
shadowNormalBias
light
.
shadowNormalBias
,
maskChannel
);
}
return
Vector3
.
zero
;
return
new
Vector4
(
0f
,
0f
,
0f
,
-
1f
)
;
}
/// <summary>
...
...
Assets/ShaderLibrary/Common.hlsl
浏览文件 @
c4e702b9
...
...
@@ -13,6 +13,10 @@
#define UNITY_MATRIX_VP unity_MatrixVP
#define UNITY_MATRIX_P glstate_matrix_projection
#if defined(_SHADOW_MASK_ALWAYS) || defined(_SHADOW_MASK_DISTANCE)
#define SHADOWS_SHADOWMASK
#endif
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"
...
...
Assets/ShaderLibrary/GI.hlsl
浏览文件 @
c4e702b9
...
...
@@ -85,13 +85,29 @@ float3 SampleLightProbe(Surface surfaceWS)
#endif
}
// 采样灯光遮挡探针
float4
SampleLightProbeOcclusion
()
{
return
unity_ProbesOcclusion
;
}
// 采样shadowMask得到烘焙阴影数据
float4
SampleBakedShadows
(
float2
lightMapUV
)
float4
SampleBakedShadows
(
float2
lightMapUV
,
Surface
surfaceWS
)
{
#if defined(LIGHTMAP_ON)
return
SAMPLE_TEXTURE2D
(
unity_ShadowMask
,
samplerunity_ShadowMask
,
lightMapUV
);
#else
return
1
.
0
;
if
(
unity_ProbeVolumeParams
.
x
)
{
return
SampleProbeOcclusion
(
TEXTURE3D_ARGS
(
unity_ProbeVolumeSH
,
samplerunity_ProbeVolumeSH
),
surfaceWS
.
position
,
unity_ProbeVolumeWorldToObject
,
unity_ProbeVolumeParams
.
y
,
unity_ProbeVolumeParams
.
z
,
unity_ProbeVolumeMin
.
xyz
,
unity_ProbeVolumeSizeInv
.
xyz
);
}
else
{
return
unity_ProbesOcclusion
;
}
#endif
}
...
...
@@ -99,11 +115,15 @@ GI GetGI(float2 lightMapUV, Surface surfaceWS)
{
GI
gi
;
gi
.
diffuse
=
SampleLightMap
(
lightMapUV
)
+
SampleLightProbe
(
surfaceWS
);
gi
.
shadowMask
.
always
=
false
;
gi
.
shadowMask
.
distance
=
false
;
gi
.
shadowMask
.
shadows
=
1
.
0
;
#if defined(_SHADOW_MASK_DISTANCE)
#if defined(_SHADOW_MASK_ALWAYS)
gi
.
shadowMask
.
always
=
true
;
gi
.
shadowMask
.
shadows
=
SampleBakedShadows
(
lightMapUV
,
surfaceWS
);
#elif defined(_SHADOW_MASK_DISTANCE)
gi
.
shadowMask
.
distance
=
true
;
gi
.
shadowMask
.
shadows
=
SampleBakedShadows
(
lightMapUV
);
gi
.
shadowMask
.
shadows
=
SampleBakedShadows
(
lightMapUV
,
surfaceWS
);
#endif
return
gi
;
}
...
...
Assets/ShaderLibrary/Light.hlsl
浏览文件 @
c4e702b9
...
...
@@ -31,9 +31,10 @@ int GetDirectionalLightCount()
DirectionalShadowData
GetDirectionalShadowData
(
int
lightIndex
,
ShadowData
shadowData
)
{
DirectionalShadowData
data
;
data
.
strength
=
_DirectionalLightShadowData
[
lightIndex
].
x
*
shadowData
.
strength
;
data
.
strength
=
_DirectionalLightShadowData
[
lightIndex
].
x
;
data
.
tileIndex
=
_DirectionalLightShadowData
[
lightIndex
].
y
+
shadowData
.
cascadeIndex
;
data
.
normalBias
=
_DirectionalLightShadowData
[
lightIndex
].
z
;
data
.
shadowMaskChannel
=
_DirectionalLightShadowData
[
lightIndex
].
w
;
return
data
;
}
...
...
Assets/ShaderLibrary/Lighting.hlsl
浏览文件 @
c4e702b9
...
...
@@ -20,7 +20,6 @@ float3 GetLighting(Surface surfaceWS, BRDF brdf, GI gi)
// 得到表面阴影数据
ShadowData
shadowData
=
GetShadowData
(
surfaceWS
);
shadowData
.
shadowMask
=
gi
.
shadowMask
;
// return gi.shadowMask.shadows.rgb;
// 可见光的光照结果进行累加得到最终光照结果
float3
color
=
gi
.
diffuse
*
brdf
.
diffuse
;
...
...
Assets/ShaderLibrary/Shadows.hlsl
浏览文件 @
c4e702b9
...
...
@@ -48,11 +48,13 @@ struct DirectionalShadowData
int
tileIndex
;
// 法线偏差
float
normalBias
;
int
shadowMaskChannel
;
};
// 烘焙阴影数据
struct
ShadowMask
{
bool
always
;
bool
distance
;
float4
shadows
;
};
...
...
@@ -100,17 +102,50 @@ float FilterDirectionalShadow(float3 positionSTS)
#endif
}
// 获取
阴影的衰减
float
Get
DirectionalShadowAttenuation
(
DirectionalShadowData
directional
,
ShadowData
global
,
Surface
surfaceWS
)
// 获取
烘焙阴影的衰减值
float
Get
BakedShadow
(
ShadowMask
mask
,
int
channel
)
{
// 如果不接受阴影,阴影衰减为1
#if !defined(_RECEIVE_SHADOWS)
return
1
.
0
;
#endif
if
(
directional
.
strength
<=
0
.
0
)
float
shadow
=
1
.
0
;
if
(
mask
.
always
||
mask
.
distance
)
{
return
1
.
0
;
if
(
channel
>
0
)
{
shadow
=
mask
.
shadows
[
channel
];
}
}
return
shadow
;
}
float
GetBakedShadow
(
ShadowMask
mask
,
int
channel
,
float
strength
)
{
if
(
mask
.
always
||
mask
.
distance
)
{
return
lerp
(
1
.
0
,
GetBakedShadow
(
mask
,
channel
),
strength
);
}
return
1
.
0
;
}
// 混合烘焙和实时阴影
float
MixBakedAndRealtimeShadows
(
ShadowData
global
,
float
shadow
,
int
shadowMaskChannel
,
float
strength
)
{
float
baked
=
GetBakedShadow
(
global
.
shadowMask
,
shadowMaskChannel
);
if
(
global
.
shadowMask
.
always
)
{
shadow
=
lerp
(
1
.
0
,
shadow
,
global
.
strength
);
shadow
=
min
(
baked
,
shadow
);
return
lerp
(
1
.
0
,
shadow
,
strength
);
}
if
(
global
.
shadowMask
.
distance
)
{
shadow
=
lerp
(
baked
,
shadow
,
global
.
strength
);
return
lerp
(
1
.
0
,
shadow
,
strength
);
}
return
lerp
(
1
.
0
,
shadow
,
strength
*
global
.
strength
);
}
// 获取级联阴影
float
GetCascadedShadow
(
DirectionalShadowData
directional
,
ShadowData
global
,
Surface
surfaceWS
)
{
// 计算法线偏移
float3
normalBias
=
surfaceWS
.
normal
*
(
directional
.
normalBias
*
_CascadeData
[
global
.
cascadeIndex
].
y
);
float3
positionSTS
=
mul
(
...
...
@@ -128,8 +163,29 @@ float GetDirectionalShadowAttenuation(DirectionalShadowData directional, ShadowD
).
xyz
;
shadow
=
lerp
(
FilterDirectionalShadow
(
positionSTS
),
shadow
,
global
.
cascadeBlend
);
}
// 最终衰减结果是阴影强度和采样衰减的线性差值
return
lerp
(
1
.
0
,
shadow
,
directional
.
strength
);
return
shadow
;
}
// 获取阴影的衰减
float
GetDirectionalShadowAttenuation
(
DirectionalShadowData
directional
,
ShadowData
global
,
Surface
surfaceWS
)
{
// 如果不接受阴影,阴影衰减为1
#if !defined(_RECEIVE_SHADOWS)
return
1
.
0
;
#endif
float
shadow
;
if
(
directional
.
strength
*
global
.
strength
<=
0
.
0
)
{
shadow
=
GetBakedShadow
(
global
.
shadowMask
,
directional
.
shadowMaskChannel
,
abs
(
directional
.
strength
));
}
else
{
shadow
=
GetCascadedShadow
(
directional
,
global
,
surfaceWS
);
// 最终衰减结果是阴影强度和采样衰减的线性差值
shadow
=
MixBakedAndRealtimeShadows
(
global
,
shadow
,
directional
.
shadowMaskChannel
,
directional
.
strength
);
}
return
shadow
;
}
// 公式计算阴影过渡时的强度
...
...
@@ -142,6 +198,7 @@ float FadedShadowStrength(float distance, float scale, float fade)
ShadowData
GetShadowData
(
Surface
surfaceWS
)
{
ShadowData
data
;
data
.
shadowMask
.
always
=
false
;
data
.
shadowMask
.
distance
=
false
;
data
.
shadowMask
.
shadows
=
1
.
0
;
data
.
cascadeBlend
=
1
.
0
;
...
...
Assets/ShaderLibrary/UnityInput.hlsl
浏览文件 @
c4e702b9
...
...
@@ -9,6 +9,8 @@ CBUFFER_START(UnityPerDraw)
// 这个矩阵包含一些在这里我们不需要的转换信息
real4
unity_WorldTransformParams
;
float4
unity_ProbesOcclusion
;
float4
unity_LightmapST
;
float4
unity_DynamicLightmapST
;
...
...
Assets/Shaders/Lit.shader
浏览文件 @
c4e702b9
...
...
@@ -56,7 +56,7 @@ Shader "Custom RP/Lit"
#pragma shader_feature _PREMULTIPLY_ALPHA
#pragma multi_compile _ _DIRECTIONAL_PCF3 _DIRECTIONAL_PCF5 _DIRECTIONAL_PCF7
#pragma multi_compile _ _CASCADE_BLEND_SOFT _CASCADE_BLEND_DITHER
#pragma multi_compile _ _SHADOW_MASK_DISTANCE
#pragma multi_compile _ _SHADOW_MASK_
ALWAYS _SHADOW_MASK_
DISTANCE
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_instancing
#pragma vertex LitPassVertex
...
...
ProjectSettings/QualitySettings.asset
浏览文件 @
c4e702b9
...
...
@@ -18,7 +18,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
0
blend
Weights
:
1
skin
Weights
:
1
textureQuality
:
1
anisotropicTextures
:
0
antiAliasing
:
0
...
...
@@ -40,6 +40,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
-
serializedVersion
:
2
name
:
Low
...
...
@@ -53,7 +54,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
0
blend
Weights
:
2
skin
Weights
:
2
textureQuality
:
0
anisotropicTextures
:
0
antiAliasing
:
0
...
...
@@ -75,6 +76,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
-
serializedVersion
:
2
name
:
Medium
...
...
@@ -88,7 +90,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
0
blend
Weights
:
2
skin
Weights
:
2
textureQuality
:
0
anisotropicTextures
:
1
antiAliasing
:
0
...
...
@@ -110,6 +112,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
-
serializedVersion
:
2
name
:
High
...
...
@@ -123,7 +126,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
1
blend
Weights
:
2
skin
Weights
:
2
textureQuality
:
0
anisotropicTextures
:
1
antiAliasing
:
0
...
...
@@ -145,6 +148,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
-
serializedVersion
:
2
name
:
Very High
...
...
@@ -158,7 +162,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
1
blend
Weights
:
4
skin
Weights
:
4
textureQuality
:
0
anisotropicTextures
:
2
antiAliasing
:
2
...
...
@@ -180,6 +184,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
-
serializedVersion
:
2
name
:
Ultra
...
...
@@ -193,7 +198,7 @@ QualitySettings:
shadowCascade2Split
:
0.33333334
shadowCascade4Split
:
{
x
:
0.06666667
,
y
:
0.2
,
z
:
0.46666667
}
shadowmaskMode
:
1
blend
Weights
:
4
skin
Weights
:
4
textureQuality
:
0
anisotropicTextures
:
2
antiAliasing
:
2
...
...
@@ -215,6 +220,7 @@ QualitySettings:
asyncUploadBufferSize
:
16
asyncUploadPersistentBuffer
:
1
resolutionScalingFixedDPIFactor
:
1
customRenderPipeline
:
{
fileID
:
0
}
excludedTargetPlatforms
:
[]
m_PerPlatformDefaultQuality
:
Android
:
2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录