更新Shader

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2026-04-11 22:16:08 +08:00
parent 04802fca15
commit e02c7f5e89
18 changed files with 21046 additions and 19118 deletions

7
Assets/Assets.sln.meta Normal file
View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 28802a2f6f0ff2942bd2a248b9b68960
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 88f0993afef43b34eb23a79fbdd94e9b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,142 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PseudoShadow
m_Shader: {fileID: 4800000, guid: b0be33a199aeb024c9b95c50aca88655, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- USE_RIM
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 5392668a037c8bf49b4479948ee1f3fd, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _RimPower: 3
- _ShadowSmoothness: 0.74
- _ShadowStrength: 1
- _ShadowThreshold: 0.11
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UseRim: 1
- _UseWorldLight: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.6698113, g: 0.609781, b: 0.609781, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FakeLightDir: {r: 0.23, g: 0.24, b: 0.24, a: 0}
- _RimColor: {r: 1, g: 1, b: 1, a: 1}
- _ShadowColor: {r: 0.22961909, g: 0.22961909, b: 0.299, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &1391350818744910211
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -1,104 +0,0 @@
Shader "Custom/ImprovedPseudoShadow" {
Properties {
[Header(Base)]
_MainTex ("Texture", 2D) = "white" {}
_Color ("Main Color", Color) = (1,1,1,1)
[Header(Shadow)]
_ShadowColor ("Shadow Color", Color) = (0.2, 0.2, 0.3, 1) // 默认偏蓝的阴影
_ShadowThreshold ("Shadow Threshold", Range(-1,1)) = 0.0
_ShadowSmoothness ("Shadow Smoothness", Range(0,1)) = 0.1
[Header(Lighting Mode)]
_UseWorldLight ("Use Fixed World Light?", Range(0,1)) = 0
_FakeLightDir ("Fake Light Dir (XYZ)", Vector) = (0.5, 1, 0.5, 0) // 模拟从右上方来的光
}
SubShader {
Tags { "RenderType"="Transparent" }
LOD 100
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// 开启 GPU Instancing 支持
#pragma multi_compile_instancing
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID // Instancing ID
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float lightFactor : TEXCOORD1; // 传递光照因子
UNITY_VERTEX_INPUT_INSTANCE_ID // Instancing ID
};
sampler2D _MainTex;
float4 _MainTex_ST;
// 声明 Instancing 属性变量
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color)
UNITY_DEFINE_INSTANCED_PROP(fixed4, _ShadowColor)
UNITY_DEFINE_INSTANCED_PROP(float4, _FakeLightDir)
UNITY_DEFINE_INSTANCED_PROP(float, _ShadowThreshold)
UNITY_DEFINE_INSTANCED_PROP(float, _ShadowSmoothness)
UNITY_DEFINE_INSTANCED_PROP(float, _UseWorldLight)
UNITY_INSTANCING_BUFFER_END(Props)
v2f vert (appdata v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(o, v);
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
float3 normalWorld = UnityObjectToWorldNormal(v.normal);
float3 lightDir;
float useWorldLight = UNITY_ACCESS_INSTANCED_PROP(Props, _UseWorldLight);
float3 fakeDir = normalize(UNITY_ACCESS_INSTANCED_PROP(Props, _FakeLightDir).xyz);
float3 viewDir = normalize(WorldSpaceViewDir(v.vertex));
// 用lerp实现分支
lightDir = normalize(lerp(viewDir, fakeDir, useWorldLight));
float dotProduct = dot(normalWorld, lightDir);
o.lightFactor = dotProduct;
return o;
}
fixed4 frag (v2f i) : SV_Target {
UNITY_SETUP_INSTANCE_ID(i);
// 获取属性
fixed4 mainColor = UNITY_ACCESS_INSTANCED_PROP(Props, _Color);
fixed4 shadowColor = UNITY_ACCESS_INSTANCED_PROP(Props, _ShadowColor);
float threshold = UNITY_ACCESS_INSTANCED_PROP(Props, _ShadowThreshold);
float smoothness = UNITY_ACCESS_INSTANCED_PROP(Props, _ShadowSmoothness);
fixed4 texCol = tex2D(_MainTex, i.uv) * mainColor;
// 改进2更平滑且可控的阈值计算 (Smoothstep)
// lightFactor 越大说明越直接面对光源
float lightIntensity = smoothstep(threshold, threshold + smoothness, i.lightFactor);
// 改进3基于光照强度的颜色插值 (Lerp)
// 0 (背光) -> ShadowColor
// 1 (受光) -> Texture Color
fixed3 finalRGB = lerp(shadowColor.rgb * texCol.rgb, texCol.rgb, lightIntensity);
return fixed4(finalRGB, texCol.a);
}
ENDCG
}
}
FallBack "VertexLit"
}

View File

@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: b0be33a199aeb024c9b95c50aca88655
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 877f21e61acbc6a4cb7a84e34c4d053f
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 0
exposeTemplateAsShader: 0
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}

View File

@@ -0,0 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6025983499883190884
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Shader Graphs_PseudoShadowGraph
m_Shader: {fileID: -6465566751694194690, guid: 877f21e61acbc6a4cb7a84e34c4d053f,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _QueueControl: 0
- _QueueOffset: 0
- _ShadowSmoothess: 0.31
- _ShadowTreshold: 0.04
- _USEWORLDLIGHT: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _FakeLightDir: {r: 0.9, g: 1.32, b: 0, a: 0}
- _ShadowColor: {r: 0.247686, g: 0.247686, b: 0.4339623, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dec78779f3858d84cbe78f2addd7d2ce
guid: b997f4a4af243a747b30114bb39a8c12
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000

View File

@@ -59,10 +59,15 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: dec78779f3858d84cbe78f2addd7d2ce, type: 2}
- {fileID: 2100000, guid: b997f4a4af243a747b30114bb39a8c12, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -80,9 +85,11 @@ MeshRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &3704386079632660708
MonoBehaviour:
@@ -97,18 +104,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 0
SerializedBytes: 29010b00000065006c0065006d0065006e00740047007500690064000000000000000000000000000000000001010d0000007300750062006d006f00640075006c0065004c006900730074002f00000000015e000000530079007300740065006d002e0043006f006c006c0065006300740069006f006e0073002e00470065006e0065007200690063002e004c00690073007400600031005b005b004900630068006e0069002e00520068007900740068006d00470061006d0065002e005300750062006d006f00640075006c00650042006100730065002c00200041007300730065006d0062006c0079002d004300530068006100720070005d005d002c0020006d00730063006f0072006c00690062000000000006000000000000000007052d010b00000065006e00610062006c00650054007900700065007300
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
SerializationNodes:
- Name: enableTypes
Entry: 6
Data:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
- Name: submoduleList
Entry: 7
Data: 0|System.Collections.Generic.List`1[[Ichni.RhythmGame.SubmoduleBase,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
connectedTab: {fileID: 0}
elementName:
tags: []
parentElement: {fileID: 0}
connectedTab: {fileID: 0}
childElementList: []
themeBundleName:
objectName:

View File

@@ -59,10 +59,15 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: dec78779f3858d84cbe78f2addd7d2ce, type: 2}
- {fileID: 2100000, guid: b997f4a4af243a747b30114bb39a8c12, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -80,9 +85,11 @@ MeshRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &3289815003423494910
MonoBehaviour:
@@ -105,6 +112,9 @@ MonoBehaviour:
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: enableTypes
Entry: 6
Data:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
@@ -121,13 +131,10 @@ MonoBehaviour:
- Name:
Entry: 8
Data:
- Name: enableTypes
Entry: 6
Data:
connectedTab: {fileID: 0}
elementName:
tags: []
parentElement: {fileID: 0}
connectedTab: {fileID: 0}
childElementList: []
themeBundleName:
objectName:

View File

@@ -59,10 +59,15 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: dec78779f3858d84cbe78f2addd7d2ce, type: 2}
- {fileID: 2100000, guid: b997f4a4af243a747b30114bb39a8c12, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -80,9 +85,11 @@ MeshRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &3515272920379503278
MonoBehaviour:
@@ -97,18 +104,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 0
SerializedBytes: 29010b00000065006c0065006d0065006e00740047007500690064000000000000000000000000000000000001010d0000007300750062006d006f00640075006c0065004c006900730074002f00000000015e000000530079007300740065006d002e0043006f006c006c0065006300740069006f006e0073002e00470065006e0065007200690063002e004c00690073007400600031005b005b004900630068006e0069002e00520068007900740068006d00470061006d0065002e005300750062006d006f00640075006c00650042006100730065002c00200041007300730065006d0062006c0079002d004300530068006100720070005d005d002c0020006d00730063006f0072006c00690062000000000006000000000000000007052d010b00000065006e00610062006c00650054007900700065007300
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
SerializationNodes:
- Name: enableTypes
Entry: 6
Data:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
- Name: submoduleList
Entry: 7
Data: 0|System.Collections.Generic.List`1[[Ichni.RhythmGame.SubmoduleBase,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
connectedTab: {fileID: 0}
elementName:
tags: []
parentElement: {fileID: 0}
connectedTab: {fileID: 0}
childElementList: []
themeBundleName:
objectName:

View File

@@ -59,10 +59,15 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: dec78779f3858d84cbe78f2addd7d2ce, type: 2}
- {fileID: 2100000, guid: b997f4a4af243a747b30114bb39a8c12, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -80,9 +85,11 @@ MeshRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &1747556452555736861
MonoBehaviour:
@@ -97,18 +104,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 0
SerializedBytes: 29010b00000065006c0065006d0065006e00740047007500690064000000000000000000000000000000000001010d0000007300750062006d006f00640075006c0065004c006900730074002f00000000015e000000530079007300740065006d002e0043006f006c006c0065006300740069006f006e0073002e00470065006e0065007200690063002e004c00690073007400600031005b005b004900630068006e0069002e00520068007900740068006d00470061006d0065002e005300750062006d006f00640075006c00650042006100730065002c00200041007300730065006d0062006c0079002d004300530068006100720070005d005d002c0020006d00730063006f0072006c00690062000000000006000000000000000007052d010b00000065006e00610062006c00650054007900700065007300
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
SerializationNodes:
- Name: enableTypes
Entry: 6
Data:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
- Name: submoduleList
Entry: 7
Data: 0|System.Collections.Generic.List`1[[Ichni.RhythmGame.SubmoduleBase,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
connectedTab: {fileID: 0}
elementName:
tags: []
parentElement: {fileID: 0}
connectedTab: {fileID: 0}
childElementList: []
themeBundleName:
objectName:

View File

@@ -59,10 +59,15 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: dec78779f3858d84cbe78f2addd7d2ce, type: 2}
- {fileID: 2100000, guid: b997f4a4af243a747b30114bb39a8c12, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -80,9 +85,11 @@ MeshRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &6450138934524257130
MonoBehaviour:
@@ -97,18 +104,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 0
SerializedBytes: 29010b00000065006c0065006d0065006e00740047007500690064000000000000000000000000000000000001010d0000007300750062006d006f00640075006c0065004c006900730074002f00000000015e000000530079007300740065006d002e0043006f006c006c0065006300740069006f006e0073002e00470065006e0065007200690063002e004c00690073007400600031005b005b004900630068006e0069002e00520068007900740068006d00470061006d0065002e005300750062006d006f00640075006c00650042006100730065002c00200041007300730065006d0062006c0079002d004300530068006100720070005d005d002c0020006d00730063006f0072006c00690062000000000006000000000000000007052d010b00000065006e00610062006c00650054007900700065007300
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes: []
SerializationNodes:
- Name: enableTypes
Entry: 6
Data:
- Name: elementGuid
Entry: 2
Data: 00000000000000000000000000000000
- Name: submoduleList
Entry: 7
Data: 0|System.Collections.Generic.List`1[[Ichni.RhythmGame.SubmoduleBase,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
connectedTab: {fileID: 0}
elementName:
tags: []
parentElement: {fileID: 0}
connectedTab: {fileID: 0}
childElementList: []
themeBundleName:
objectName:

View File

@@ -37,16 +37,15 @@ namespace Ichni.RhythmGame
public override void Refresh()
{
base.Refresh();
if (shadowRenderer == null || shadowRenderer.material == null) return;
var mat = shadowRenderer.material;
MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
materialPropertyBlock.SetColor("_Color", colorSubmodule.currentBaseColor);
materialPropertyBlock.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
materialPropertyBlock.SetFloat("_ShadowThreshold", shadowThreshold);
materialPropertyBlock.SetFloat("_ShadowSmoothness", shadowSmoothness);
materialPropertyBlock.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
materialPropertyBlock.SetFloat("_UseWorldLight", useWorldLight ? 1 : 0);
shadowRenderer.SetPropertyBlock(materialPropertyBlock);
Material material = shadowRenderer.material;
material.SetColor("_Color", colorSubmodule.currentBaseColor);
material.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
material.SetFloat("_ShadowThreshold", shadowThreshold);
material.SetFloat("_ShadowSmoothness", shadowSmoothness);
material.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
if (useWorldLight) material.EnableKeyword("_USEWORLDLIGHT");
else material.DisableKeyword("_USEWORLDLIGHT");
}
// 可选:在属性变更时自动刷新