提交 0d152532 编写于 作者: timchen1002's avatar timchen1002

initial commit

上级
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
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: 0541bba9596b30844bd298f80ab9eed1, type: 3}
m_Name: Custom_RP
m_EditorClassIdentifier:
useDynamicBatching: 0
useGPUInstancing: 1
useSRPBatcher: 1
shadows:
maxDistance: 16
distanceFade: 0.1
directional:
atlasSize: 4096
filter: 2
cascadeCount: 4
cascadeRatio1: 0.3
cascadeRatio2: 0.4
cascadeRatio3: 0.5
cascadeFade: 0.1
cascadeBlend: 1
fileFormatVersion: 2
guid: e10714eb9eadeae4893bcb2fd9868c80
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3a7a51bb7a9e4684d9e48ffbdbc89aa5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit Clip
m_Shader: {fileID: 4800000, guid: 6848ac66b88696c4ea2f1389e0877b8e, type: 3}
m_ShaderKeywords: _CLIPPING _RECEIVE_SHADOWS _SHADOWS_DITHER
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2450
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 5c8805d759cc642b5845cd761592c0c0, type: 3}
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: 5c8805d759cc642b5845cd761592c0c0, 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}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Clipping: 1
- _Cutoff: 0.61
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _PremulAlpha: 0
- _PremulAlphax: 0
- _ReceiveShadows: 1
- _Shadows: 2
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.5, g: 0.5, b: 0.5, 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: []
fileFormatVersion: 2
guid: f7152e1e3f0bfdd49b0284c702bfa510
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_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit Opague Baked Emissive
m_Shader: {fileID: 4800000, guid: 6848ac66b88696c4ea2f1389e0877b8e, type: 3}
m_ShaderKeywords: _RECEIVE_SHADOWS
m_LightmapFlags: 2
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses: []
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: 10300, guid: 0000000000000000f000000000000000, type: 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}
- _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}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Clipping: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _PremulAlpha: 0
- _ReceiveShadows: 1
- _Shadows: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
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: 0, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: 986139d63a4a1de47bc4e16456a0f5f3
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_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit Opague
m_Shader: {fileID: 4800000, guid: 6848ac66b88696c4ea2f1389e0877b8e, type: 3}
m_ShaderKeywords: _RECEIVE_SHADOWS
m_LightmapFlags: 0
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses: []
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: 0}
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}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Clipping: 0
- _Cutoff: 0.516
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0.501
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _PremulAlpha: 0
- _ReceiveShadows: 1
- _Shadows: 0
- _Smoothness: 0.68
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1}
- _Color: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: b48557b636b3ee344bb1d9ac0e16e0e6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit Transparent
m_Shader: {fileID: 4800000, guid: 6848ac66b88696c4ea2f1389e0877b8e, type: 3}
m_ShaderKeywords: _PREMULTIPLY_ALPHA _SHADOWS_DITHER
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 5c8805d759cc642b5845cd761592c0c0, type: 3}
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: 5c8805d759cc642b5845cd761592c0c0, 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}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Clipping: 0
- _Cutoff: 1
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _PremulAlpha: 1
- _PremulAlphax: 0
- _ReceiveShadows: 1
- _Shadows: 2
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _Color: {r: 0.7294118, g: 0.8588236, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: 3f9cfd75bf046804da74f14135efcde8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5c8805d759cc642b5845cd761592c0c0
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit Blue Clip
m_Shader: {fileID: 4800000, guid: f9b6d8c713e140648abcabcb6381316f, type: 3}
m_ShaderKeywords: _CLIPPING _SHADOWS_DITHER
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2450
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 5c8805d759cc642b5845cd761592c0c0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Clipping: 1
- _Cull: 2
- _Cutoff: 0.48
- _DstBlend: 0
- _Shadows: 2
- _SrcBlend: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.011569952, g: 0.17123538, b: 0.49056602, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: d195bfd2aa0ae42d2b92e6db51146f5a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit Green Opaque
m_Shader: {fileID: 4800000, guid: f9b6d8c713e140648abcabcb6381316f, type: 3}
m_ShaderKeywords: _SHADOWS_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Clipping: 0
- _Cull: 2
- _Cutoff: 0.5
- _DstBlend: 0
- _Shadows: 0
- _SrcBlend: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.41770938, g: 0.7075472, b: 0.36378607, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: 76a36e8b72e434960af23564c26cfe8e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit Instanced Clip
m_Shader: {fileID: 4800000, guid: f9b6d8c713e140648abcabcb6381316f, type: 3}
m_ShaderKeywords: _CLIPPING _SHADOWS_DITHER
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2450
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 5c8805d759cc642b5845cd761592c0c0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Clipping: 1
- _Cull: 2
- _Cutoff: 0.271
- _DstBlend: 0
- _Shadows: 2
- _SrcBlend: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: 4081442a75d414db490dcc00af055df4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit Red Opaque
m_Shader: {fileID: 4800000, guid: f9b6d8c713e140648abcabcb6381316f, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Clipping: 0
- _Cull: 2
- _Cutoff: 0.5
- _DstBlend: 10
- _Shadows: 0
- _SrcBlend: 5
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0.8207547, g: 0.18970275, b: 0.18970275, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: b49fb4a37819f4fd1b58ff3e374e7cc1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit Yellow Transparent
m_Shader: {fileID: 4800000, guid: f9b6d8c713e140648abcabcb6381316f, type: 3}
m_ShaderKeywords: _SHADOWS_DITHER
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 5c8805d759cc642b5845cd761592c0c0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Clipping: 0
- _Cull: 2
- _Cutoff: 0.2
- _DstBlend: 10
- _Shadows: 2
- _SrcBlend: 5
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 0.92719114, b: 0, a: 0.49803922}
- _Color: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
fileFormatVersion: 2
guid: f622cecbb39254e169592126596c3ca4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5105ef07608ce8d46a77e94ee0a6fd8a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e2a4b7ede76e4af4fb4257401dcb4f38
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
此差异已折叠。
fileFormatVersion: 2
guid: b9571aa5227604142af28ef6f1574e67
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 85d916ba4b10e5a439529112c914edd1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d8ba05fd5d927064b8edccb12f092618
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 1
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 3
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 6
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8c14825d4452f5b4492c963b62481681
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 1
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 3
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 11
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d2b4b32fdde91cd48a302e248d09e219
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Baked LightSettings
serializedVersion: 3
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_BakeResolution: 20
m_Padding: 2
m_TextureCompression: 0
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 0
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
fileFormatVersion: 2
guid: b7908db805350004dbfd6481e8c952db
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:
此差异已折叠。
fileFormatVersion: 2
guid: f7f2953c9746f194982804f6b5148a7b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: badeaaa8bec5ff346a91dbf82418c783
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 61301eaf64b8175428a85c48c776f417
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 扩展材质面板
/// </summary>
public class CustomShaderGUI : ShaderGUI
{
MaterialEditor editor;
Object[] materials;
MaterialProperty[] properties;
bool showPresents;
// 投影模式:开启投影、裁剪投影、抖动投影、关闭投影
enum ShadowMode
{
On, Clip, Dither, Off
}
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
EditorGUI.BeginChangeCheck();
base.OnGUI(materialEditor, properties);
editor = materialEditor;
materials = materialEditor.targets;
this.properties = properties;
BakedEmission();
EditorGUILayout.Space();
showPresents = EditorGUILayout.Foldout(showPresents, "Presents", true);
if (showPresents)
{
OpaquePreset();
ClipPreset();
FadePreset();
TransparentPreset();
}
// 如果材质属性有被更改,检查阴影模式的设置状态
if (EditorGUI.EndChangeCheck())
{
SetShadowCasterPass();
CopyLightMappingProperties();
}
}
void CopyLightMappingProperties()
{
MaterialProperty mainTex = FindProperty("_MainTex", properties, false);
MaterialProperty baseMap = FindProperty("_BaseMap", properties, false);
if (mainTex != null && baseMap != null) {
mainTex.textureValue = baseMap.textureValue;
mainTex.textureScaleAndOffset = baseMap.textureScaleAndOffset;
}
MaterialProperty color = FindProperty("_Color", properties, false);
MaterialProperty baseColor = FindProperty("_BaseColor", properties, false);
if (color != null && baseColor != null)
{
color.colorValue = baseColor.colorValue;
}
}
/// <summary>
/// 相关属性存在时可以设置关键字开关
/// </summary>
/// <param name="name"></param>
/// <param name="keyword"></param>
/// <param name="value"></param>
void SetProperty(string name, string keyword, bool value)
{
if (SetProperty(name, value ? 1f : 0f))
{
SetKeyword(keyword, value);
}
}
/// <summary>
/// 设置材质属性
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <returns></returns>
bool SetProperty(string name, float value)
{
MaterialProperty property = FindProperty(name, properties, false);
if (property != null)
{
property.floatValue = value;
return true;
}
return false;
}
/// <summary>
/// 设置关键字状态
/// </summary>
/// <param name="keyword"></param>
/// <param name="enabled"></param>
void SetKeyword(string keyword, bool enabled)
{
if (enabled)
{
foreach (Material m in materials)
{
m.EnableKeyword(keyword);
}
}
else
{
foreach (Material m in materials)
{
m.DisableKeyword(keyword);
}
}
}
bool Clipping
{
set => SetProperty("_Clipping", "_CLIPPING", value);
}
bool PremultiplyAlpha
{
set => SetProperty("_PremulAlpha", "_PREMULTIPLY_ALPHA", value);
}
BlendMode SrcBlend
{
set => SetProperty("_SrcBlend", (float)value);
}
BlendMode DstBlend
{
set => SetProperty("_DstBlend", (float)value);
}
bool ZWrite
{
set => SetProperty("_ZWrite", value ? 1f : 0f);
}
RenderQueue RenderQueue
{
set
{
foreach (Material m in materials)
{
m.renderQueue = (int)value;
}
}
}
// 如果shader的预乘属性不存在,不需要显示该渲染模式的按钮
bool HasProperty(string name) => FindProperty(name, properties, false) != null;
bool HasPremultiplyAlpha => HasProperty("_PremulAlpha");
bool PresetButton(string name)
{
if (GUILayout.Button(name)) {
editor.RegisterPropertyChangeUndo(name);
return true;
}
return false;
}
/// <summary>
/// 烘焙自发光
/// </summary>
void BakedEmission()
{
EditorGUI.BeginChangeCheck();
editor.LightmapEmissionProperty();
if (EditorGUI.EndChangeCheck())
{
foreach (Material m in editor.targets)
{
m.globalIlluminationFlags &= ~MaterialGlobalIlluminationFlags.EmissiveIsBlack;
}
}
}
/// <summary>
/// 不透明材质默认设置
/// </summary>
void OpaquePreset()
{
if (PresetButton("Opaque"))
{
Clipping = false;
PremultiplyAlpha = false;
SrcBlend = BlendMode.One;
DstBlend = BlendMode.Zero;
ZWrite = true;
RenderQueue = RenderQueue.Geometry;
}
}
/// <summary>
/// 裁切材质默认设置
/// </summary>
void ClipPreset()
{
if (PresetButton("Clip"))
{
Clipping = true;
PremultiplyAlpha = false;
SrcBlend = BlendMode.One;
DstBlend = BlendMode.Zero;
ZWrite = true;
RenderQueue = RenderQueue.AlphaTest;
}
}
/// <summary>
/// 标准透明材质默认设置
/// </summary>
void FadePreset()
{
if (PresetButton("Fade"))
{
Clipping = false;
PremultiplyAlpha = false;
SrcBlend = BlendMode.SrcAlpha;
DstBlend = BlendMode.OneMinusSrcAlpha;
ZWrite = false;
RenderQueue = RenderQueue.Transparent;
}
}
/// <summary>
/// 受光正确的透明材质默认设置
/// </summary>
void TransparentPreset()
{
if (HasPremultiplyAlpha && PresetButton("Transparent"))
{
Clipping = false;
PremultiplyAlpha = true;
SrcBlend = BlendMode.One;
DstBlend = BlendMode.OneMinusSrcAlpha;
ZWrite = false;
RenderQueue = RenderQueue.Transparent;
}
}
ShadowMode Shadows
{
set
{
if (SetProperty("_Shadows", (float)value))
{
SetKeyword("_SHADOWS_CLIP", value == ShadowMode.Clip);
SetKeyword("_SHADOWS_DITHER", value == ShadowMode.Dither);
}
}
}
/// <summary>
/// 设置材质的ShadowCaster pass块是否启用
/// </summary>
void SetShadowCasterPass()
{
MaterialProperty shadows = FindProperty("_Shadows", properties, false);
if (shadows == null || shadows.hasMixedValue)
{
return;
}
bool enabled = shadows.floatValue < (float)ShadowMode.Off;
foreach (Material m in materials)
{
m.SetShaderPassEnabled("ShadowCaster", enabled);
}
}
}
fileFormatVersion: 2
guid: 63f209c1640cac74884a5a7d9b8a6bbb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 71cb5ce47a3c0ad4689c76000c3bb7e4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 生成1023个mesh和小球对象
/// </summary>
public class MeshBall : MonoBehaviour
{
static int baseColorId = Shader.PropertyToID("_BaseColor");
static int metallicId = Shader.PropertyToID("_Metallic");
static int smoothnessId = Shader.PropertyToID("_Smoothness");
[SerializeField]
Mesh mesh = default;
[SerializeField]
Material material = default;
[SerializeField]
LightProbeProxyVolume lightProbeVolume = null;
// 添加金属度和光滑度属性调节参数
Matrix4x4[] matrices = new Matrix4x4[1023];
Vector4[] baseColors = new Vector4[1023];
MaterialPropertyBlock block;
float[] metallic = new float[1023];
float[] smoothness = new float[1023];
void Awake()
{
for (int i = 0; i < matrices.Length; i++)
{
// 创建随机转换矩阵和颜色
matrices[i] = Matrix4x4.TRS(
Random.insideUnitSphere * 10f,
Quaternion.Euler(
Random.value * 360f, Random.value * 360f, Random.value * 360f
),
Vector3.one * Random.Range(0.5f, 1.5f)
);
baseColors[i] = new Vector4(
Random.value, Random.value, Random.value,
Random.Range(0.5f, 1f)
);
// 金属度和光滑度按条件随机
metallic[i] = Random.value < 0.25f ? 1f : 0f;
smoothness[i] = Random.Range(0.05f, 0.95f);
}
}
void Update()
{
if (block == null)
{
// 随机属性发送到着色器
block = new MaterialPropertyBlock();
block.SetVectorArray(baseColorId, baseColors);
block.SetFloatArray(metallicId, metallic);
block.SetFloatArray(smoothnessId, smoothness);
if (!lightProbeVolume)
{
var positions = new Vector3[1023];
for (int i = 0; i < matrices.Length; i++)
{
positions[i] = matrices[i].GetColumn(3);
}
var lightProbes = new SphericalHarmonicsL2[1023];
var occlusionProbes = new Vector4[1023];
LightProbes.CalculateInterpolatedLightAndOcclusionProbes(
positions, lightProbes, occlusionProbes
);
block.CopySHCoefficientArraysFrom(lightProbes);
block.CopyProbeOcclusionArrayFrom(occlusionProbes);
}
}
// 绘制网格实例
Graphics.DrawMeshInstanced(mesh, 0, material, matrices, 1023, block,
ShadowCastingMode.On, true, 0, null, lightProbeVolume ? LightProbeUsage.UseProxyVolume : LightProbeUsage.CustomProvided, lightProbeVolume);
}
}
fileFormatVersion: 2
guid: 8e200ec0b15a385468e1ad94ba6331ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
/// <summary>
/// 挂到同材质对象上,可以为每个对象设置不同的属性
/// </summary>
[DisallowMultipleComponent]
public class PerObjectMaterialProperties : MonoBehaviour
{
static int baseColorId = Shader.PropertyToID("_BaseColor");
static int cutoffId = Shader.PropertyToID("_Cutoff");
static int metallicId = Shader.PropertyToID("_Metallic");
static int smoothnessId = Shader.PropertyToID("_Smoothness");
static int emissionColorId = Shader.PropertyToID("_EmissionColor");
[SerializeField]
Color baseColor = Color.white;
[SerializeField, Range(0f, 1f)]
float alphaCutoff = 0.5f, metallic = 0f, smoothness = 0.5f;
[SerializeField, ColorUsage(false, true)]
Color emissionColor = Color.black;
static MaterialPropertyBlock block;
void Awake()
{
OnValidate();
}
void OnValidate()
{
if (block == null)
{
block = new MaterialPropertyBlock();
}
// 设置材质属性
block.SetColor(baseColorId, baseColor);
block.SetFloat(cutoffId, alphaCutoff);
block.SetFloat(metallicId, metallic);
block.SetFloat(smoothnessId, smoothness);
block.SetColor(emissionColorId, emissionColor);
GetComponent<Renderer>().SetPropertyBlock(block);
}
}
fileFormatVersion: 2
guid: be15b46f5c3ccb44996b3508a76c4bf2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fc71a22a99a17fb42a0ecc13ae7ac927
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Profiling;
/// <summary>
/// 相机渲染管理类
/// </summary>
partial class CameraRenderer
{
partial void DrawGizmos();
partial void DrawUnsupportedShaders();
#if UNITY_EDITOR
// SRP不支持的着色器标签类型
static ShaderTagId[] legacyShaderTagIds = {
new ShaderTagId("Always"),
new ShaderTagId("ForwardBase"),
new ShaderTagId("PrepassBase"),
new ShaderTagId("Vertex"),
new ShaderTagId("VertexLMRGBM"),
new ShaderTagId("VertexLM"),
};
// 绘制成使用错误材质的粉红色颜色
static Material errorMaterial;
partial void PrepareForSceneWindow();
partial void PrepareBuffer();
string sampleName { get; set; }
/// <summary>
/// 绘制SRP不支持的内置着色器
/// </summary>
partial void DrawUnsupportedShaders()
{
if (errorMaterial == null)
{
errorMaterial = new Material(Shader.Find("Hidden/InternalErrorShader"));
}
var drawingSettings = new DrawingSettings(legacyShaderTagIds[0], new SortingSettings(camera))
{
overrideMaterial = errorMaterial
};
for (int i = 1; i < legacyShaderTagIds.Length; i++)
{
drawingSettings.SetShaderPassName(i, legacyShaderTagIds[i]);
}
var fliteringSettings = FilteringSettings.defaultValue;
// 可以通过 FilteringSettings.defaultValue 属性获得默认的过滤设置
context.DrawRenderers(cullingResults, ref drawingSettings, ref fliteringSettings);
}
/// <summary>
/// 绘制Gizmos
/// </summary>
/// <returns></returns>
partial void DrawGizmos()
{
if (Handles.ShouldRenderGizmos())
{
context.DrawGizmos(camera, GizmoSubset.PreImageEffects);
context.DrawGizmos(camera, GizmoSubset.PostImageEffects);
}
}
/// <summary>
/// 在Game视图绘制的几何体也绘制到Scene视图中
/// </summary>
/// <returns></returns>
partial void PrepareForSceneWindow()
{
if (camera.cameraType == CameraType.SceneView)
{
// 如果切换到了Scene视图,调用次方法完成绘制
ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
}
}
/// <summary>
/// 设置buffer缓冲区的名字
/// </summary>
/// <returns></returns>
partial void PrepareBuffer()
{
// 设置只有在编辑器模式下才分配内存
Profiler.BeginSample("Editor Only");
buffer.name = camera.name;
Profiler.EndSample();
}
#else
const string sampleName = bufferName;
#endif
}
fileFormatVersion: 2
guid: ad3150bd302b9684e9244154722b4d93
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 相机渲染管理类:单独控制每个相机的渲染
/// </summary>
public partial class CameraRenderer
{
ScriptableRenderContext context;
Camera camera;
const string bufferName = "Render Camera";
// 创建缓冲区
CommandBuffer buffer = new CommandBuffer
{
name = bufferName
};
// 存储相机剔除后的结果
CullingResults cullingResults;
// 着色器标记ID
static ShaderTagId unlitShaderTagId = new ShaderTagId("SRPDefaultUnlit");
static ShaderTagId litShaderTagId = new ShaderTagId("CustomLit");
Lighting lighting = new Lighting();
/// <summary>
/// 相机渲染
/// </summary>
/// <param name="context"></param>
/// <param name="camera"></param>
/// <param name="useDynamicBatching"></param>
/// <param name="useGPUInstancing"></param>
/// <param name="shadowSettings"></param>
public void Render(ScriptableRenderContext context, Camera camera, bool useDynamicBatching, bool useGPUInstancing, ShadowSettings shadowSettings)
{
this.context = context;
this.camera = camera;
// 设置buffer缓冲区的名字
PrepareBuffer();
// 在Game视图绘制的几何体也绘制到Scene视图中
PrepareForSceneWindow();
if (!Cull(shadowSettings.maxDistance))
{
return;
}
buffer.BeginSample(sampleName);
ExecuteBuffer();
lighting.Setup(context, cullingResults, shadowSettings);
buffer.EndSample(sampleName);
Setup();
// 绘制可见几何体
DrawVisibleGeometry(useDynamicBatching, useGPUInstancing);
// 绘制SRP不支持的内置shader类型
DrawUnsupportedShaders();
// 绘制Gizmos
DrawGizmos();
// 释放申请的RT内存空间
lighting.Cleanup();
// 提交缓冲区
Submit();
}
/// <summary>
/// 剔除
/// </summary>
/// <returns></returns>
bool Cull(float maxShadowDistance)
{
if (camera.TryGetCullingParameters(out ScriptableCullingParameters p))
{
p.shadowDistance = Mathf.Min(maxShadowDistance, camera.farClipPlane);
cullingResults = context.Cull(ref p);
return true;
}
return false;
}
/// <summary>
/// 设置相机的属性和矩阵,在着色器中被称为unity_matrixvp
/// </summary>
void Setup()
{
context.SetupCameraProperties(camera);
// 得到相机的clearflags
CameraClearFlags flags = camera.clearFlags;
// 设置相机清除状态
buffer.ClearRenderTarget(flags <= CameraClearFlags.Depth, flags == CameraClearFlags.Color, flags == CameraClearFlags.Color ? camera.backgroundColor.linear : Color.clear);
buffer.BeginSample(sampleName);
ExecuteBuffer();
}
/// <summary>
/// 提交缓冲区命令
/// </summary>
void Submit()
{
buffer.EndSample(sampleName);
ExecuteBuffer();
context.Submit();
}
/// <summary>
/// 执行缓冲区命令
/// </summary>
void ExecuteBuffer()
{
context.ExecuteCommandBuffer(buffer);
buffer.Clear();
}
/// <summary>
/// 绘制可见几何体,顺序:不透明物体->天空盒->透明物体
/// </summary>
void DrawVisibleGeometry(bool useDynamicBatching, bool useGPUInstancing)
{
// 设置绘制顺序和指定渲染相机
var sortingSettings = new SortingSettings(camera)
{
criteria = SortingCriteria.CommonOpaque
};
// 设置渲染的shader pass和渲染顺序
var drawingSettings = new DrawingSettings(unlitShaderTagId, sortingSettings)
{
enableDynamicBatching = useDynamicBatching,
enableInstancing = useGPUInstancing,
perObjectData = PerObjectData.Lightmaps | PerObjectData.ShadowMask | PerObjectData.LightProbe | PerObjectData.OcclusionProbe | PerObjectData.LightProbeProxyVolume,
};
// 渲染CustomLit表示的pass块
drawingSettings.SetShaderPassName(1, litShaderTagId);
// 只绘制RenderQueue为opaque不透明物体
var filteringSettings = new FilteringSettings(RenderQueueRange.opaque);
// 绘制不透明物体
context.DrawRenderers(cullingResults, ref drawingSettings, ref filteringSettings);
// 绘制天空盒
context.DrawSkybox(camera);
sortingSettings.criteria = SortingCriteria.CommonTransparent;
drawingSettings.sortingSettings = sortingSettings;
// 只绘制RenderQueue为transparent透明的物体
filteringSettings.renderQueueRange = RenderQueueRange.transparent;
// 绘制透明物体
context.DrawRenderers(cullingResults, ref drawingSettings, ref filteringSettings);
}
}
fileFormatVersion: 2
guid: a9e70a38f407c0e40bc30bc4ea0ec3f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 自定义渲染管线实例
/// </summary>
public class CustomRenderPipeline : RenderPipeline
{
CameraRenderer renderer = new CameraRenderer();
bool useDynamicBatching, useGPUInstancing, useSRPBatcher;
// 阴影的配置
ShadowSettings shadowSettings;
public CustomRenderPipeline(bool useDynamicBatching, bool useGPUInstancing, bool useSRPBatcher, ShadowSettings shadowSettings)
{
this.useDynamicBatching = useDynamicBatching;
this.useGPUInstancing = useGPUInstancing;
this.shadowSettings = shadowSettings;
// 在运行时启用SRP批处理程序(实验性)
GraphicsSettings.useScriptableRenderPipelineBatching = useSRPBatcher;
// 灯光使用线性强度
GraphicsSettings.lightsUseLinearIntensity = true;
}
protected override void Render(ScriptableRenderContext context, Camera[] cameras)
{
// 遍历所有相机单独渲染
foreach (Camera camera in cameras)
{
renderer.Render(context, camera, useDynamicBatching, useGPUInstancing, shadowSettings);
}
}
}
fileFormatVersion: 2
guid: 7801b1ecb6785ac4e879356c5121b295
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 自定义渲染管线资产
/// </summary>
[CreateAssetMenu(menuName = "Rendering/Custom Render Pipeline")]
public class CustomRenderPipelineAsset : RenderPipelineAsset
{
[SerializeField]
bool useDynamicBatching = true, useGPUInstancing = true, useSRPBatcher = true;
[SerializeField]
ShadowSettings shadows = default;
protected override RenderPipeline CreatePipeline()
{
return new CustomRenderPipeline(useDynamicBatching, useGPUInstancing, useSRPBatcher, shadows);
}
}
fileFormatVersion: 2
guid: 0541bba9596b30844bd298f80ab9eed1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
using Unity.Collections;
/// <summary>
/// 灯光类管理
/// </summary>
public class Lighting
{
const string bufferName = "Lighting";
// 存储相机剔除后的结果
CullingResults cullingResults;
CommandBuffer buffer = new CommandBuffer{
name = bufferName
};
// 设置最大可见定向光数量
const int maxDirLightCount = 4;
static int dirLightCountId = Shader.PropertyToID("_DirectionalLightCount");
static int dirLightColorsId = Shader.PropertyToID("_DirectionalLightColors");
static int dirLightDirectionsId = Shader.PropertyToID("_DirectionalLightDirections");
static int dirLightShadowDataId = Shader.PropertyToID("_DirectionalLightShadowData");
// 存储定向光的颜色和方向
static Vector4[] dirLightColors = new Vector4[maxDirLightCount];
static Vector4[] dirLightDirections = new Vector4[maxDirLightCount];
static Vector4[] dirLightShadowData = new Vector4[maxDirLightCount];
Shadows shadows = new Shadows();
/// <summary>
/// 初始化设置
/// </summary>
/// <param name="context"></param>
/// <param name="cullingResults"></param>
/// <param name="shadowSettings"></param>
public void Setup(ScriptableRenderContext context, CullingResults cullingResults, ShadowSettings shadowSettings)
{
this.cullingResults = cullingResults;
buffer.BeginSample(bufferName);
// 阴影的初始化设置
shadows.Setup(context, cullingResults, shadowSettings);
// 存储并发送所有光源数据
SetupLights();
// 渲染阴影
shadows.Render();
buffer.EndSample(bufferName);
context.ExecuteCommandBuffer(buffer);
buffer.Clear();
}
/// <summary>
/// 存储并发送所有光源数据
/// </summary>
void SetupLights()
{
// 得到所有影响相机渲染物体的可见光数据
NativeArray<VisibleLight> visibleLights = cullingResults.visibleLights;
int dirLightCount = 0;
for (int i = 0; i < visibleLights.Length; i++)
{
VisibleLight visibleLight = visibleLights[i];
if (visibleLight.lightType == LightType.Directional)
{
// VisibleLight结构很大,我们改为传递引用不是传递值,这样不会生成副本
SetupDirectionalLight(dirLightCount++, ref visibleLight);
// 当超过灯光限制数量中止循环
if (dirLightCount >= maxDirLightCount)
{
break;
}
}
}
buffer.SetGlobalInt(dirLightCountId, dirLightCount);
buffer.SetGlobalVectorArray(dirLightColorsId, dirLightColors);
buffer.SetGlobalVectorArray(dirLightDirectionsId, dirLightDirections);
buffer.SetGlobalVectorArray(dirLightShadowDataId, dirLightShadowData);
}
/// <summary>
/// 存储定向光的数据
/// </summary>
/// <param name="index"></param>
/// <param name="visibleLight"></param>
void SetupDirectionalLight(int index, ref VisibleLight visibleLight)
{
dirLightColors[index] = visibleLight.finalColor;
// 通过VisibleLight.localToWorldMatrix属性找到前向矢量,它在矩阵第三列,还要进行取反
dirLightDirections[index] = -visibleLight.localToWorldMatrix.GetColumn(2);
// 存储阴影数据
dirLightShadowData[index] = shadows.ReserveDirectionalShadows(visibleLight.light, index);
}
/// <summary>
/// 释放申请的RT内存
/// </summary>
public void Cleanup()
{
shadows.Cleanup();
}
}
fileFormatVersion: 2
guid: aebeb6b4a96844aeb9f722e99b5a394a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
/// <summary>
/// 渲染管线中的阴影配置
/// </summary>
[System.Serializable]
public class ShadowSettings
{
// 阴影最大距离
[Min(0.001f)]
public float maxDistance = 100f;
// 阴影过渡距离
[Range(0.001f, 1f)]
public float distanceFade = 0.1f;
// 阴影图集大小
public enum MapSize
{
_256 = 256, _512 = 512, _1024 = 1024, _2048 = 2048, _4096 = 4096, _8192 = 8192
}
// PCF滤波模式
public enum FilterMode
{
PCF2x2, PCF3x3, PCF5x5, PCF7x7
}
// 定向光源的阴影配置
[System.Serializable]
public struct Directional
{
public MapSize atlasSize;
public FilterMode filter;
// 级联数量
[Range(1, 4)]
public int cascadeCount;
// 级联比例
[Range(0f, 1f)]
public float cascadeRatio1, cascadeRatio2, cascadeRatio3;
public Vector3 CascadeRatios => new Vector3(cascadeRatio1, cascadeRatio2, cascadeRatio3);
// 级联过渡值
[Range(0.001f, 1f)]
public float cascadeFade;
// 级联混合模式
public enum CascadeBlendMode
{
Hard, Soft, Dither
}
public CascadeBlendMode cascadeBlend;
}
// 设置阴影配置的默认值
public Directional directional = new Directional
{
atlasSize = MapSize._1024,
filter = FilterMode.PCF2x2,
cascadeCount = 4,
cascadeRatio1 = 0.1f,
cascadeRatio2 = 0.25f,
cascadeRatio3 = 0.5f,
cascadeFade = 0.1f,
cascadeBlend = Directional.CascadeBlendMode.Hard
};
}
fileFormatVersion: 2
guid: 40207171a73304302b2657aff37fed42
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 阴影管理类
/// </summary>
public class Shadows
{
const string bufferName = "Shadows";
CommandBuffer buffer = new CommandBuffer
{
name = bufferName
};
ScriptableRenderContext context;
CullingResults cullingResults;
ShadowSettings shadowSettings;
bool useShadowMask;
// 可投射阴影的定向光源最大数量
const int maxShadowedDirLightCount = 4;
// 最大级联数量
const int maxCascades = 4;
// 定向光的阴影数据
struct ShadowedDirectionalLight
{
// 可见光索引
public int visibleLightIndex;
// 斜度比例偏差值
public float slopeScaleBias;
// 近平面偏移
public float nearPlaneOffset;
}
// 存储可投射阴影的定向光源的数据
ShadowedDirectionalLight[] shadowedDirectionalLights = new ShadowedDirectionalLight[maxShadowedDirLightCount];
// 已存储的可投射阴影的定向光数量
int shadowedDirectionalLightCount;
static int dirShadowAtlasId = Shader.PropertyToID("_DirectionalShadowAtlas");
static int dirShadowMatricesId = Shader.PropertyToID("_DirectionalShadowMatrices");
static int cascadeCountId = Shader.PropertyToID("_CascadeCount");
static int cascadeCullingSpheresId = Shader.PropertyToID("_CascadeCullingSpheres");
static int cascadeDataId = Shader.PropertyToID("_CascadeData");
static int shadowAtlasSizeId = Shader.PropertyToID("_ShadowAtlasSize");
static int shadowDistanceFadeId = Shader.PropertyToID("_ShadowDistanceFade");
// 存储光源的阴影转换矩阵
static Matrix4x4[] dirShadowMatrices = new Matrix4x4[maxShadowedDirLightCount * maxCascades];
// 存储级联包围球数据
static Vector4[] cascadeCullingSpheres = new Vector4[maxCascades];
// 存储级联数据
static Vector4[] cascadeData = new Vector4[maxCascades];
// 定向光源的PCF滤波模式
static string[] directionalFilterKeywords = {
"_DIRECTIONAL_PCF3",
"_DIRECTIONAL_PCF5",
"_DIRECTIONAL_PCF7",
};
// 级联混合模式
static string[] cascadeBlendKeywords = {
"_CASCADE_BLEND_SOFT",
"_CASCADE_BLEND_DITHER",
};
static string[] shadowMaskKeywords =
{
"_SHADOW_MASK_ALWAYS",
"_SHADOW_MASK_DISTANCE",
};
public void Setup(ScriptableRenderContext context, CullingResults cullingResults, ShadowSettings shadowSettings)
{
this.context = context;
this.cullingResults = cullingResults;
this.shadowSettings = shadowSettings;
shadowedDirectionalLightCount = 0;
useShadowMask = false;
}
/// <summary>
/// 执行缓冲区命令并清除缓冲区
/// </summary>
void ExecuteBuffer()
{
context.ExecuteCommandBuffer(buffer);
buffer.Clear();
}
/// <summary>
/// 存储定向光源的阴影数据
/// </summary>
/// <param name="light"></param>
/// <param name="visibleLightIndex"></param>
/// <returns></returns>
public Vector4 ReserveDirectionalShadows(Light light, int visibleLightIndex)
{
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 Vector4(
light.shadowStrength,
shadowSettings.directional.cascadeCount * shadowedDirectionalLightCount++,
light.shadowNormalBias,
maskChannel
);
}
return new Vector4(0f, 0f, 0f, -1f);
}
/// <summary>
/// 渲染阴影
/// </summary>
public void Render()
{
if (shadowedDirectionalLightCount > 0)
{
RenderDirectionalShadows();
}
else
{
buffer.GetTemporaryRT(dirShadowAtlasId, 1, 1, 32, FilterMode.Bilinear, RenderTextureFormat.Shadowmap);
}
// 是否使用阴影蒙版
buffer.BeginSample(bufferName);
SetKeyWords(shadowMaskKeywords, useShadowMask ? QualitySettings.shadowmaskMode == ShadowmaskMode.Shadowmask ? 0 : 1 : -1);
buffer.EndSample(bufferName);
ExecuteBuffer();
}
/// <summary>
/// 渲染定向光阴影
/// </summary>
void RenderDirectionalShadows()
{
int atlasSize = (int)shadowSettings.directional.atlasSize;
buffer.GetTemporaryRT(dirShadowAtlasId, atlasSize, atlasSize, 32, FilterMode.Bilinear, RenderTextureFormat.Shadowmap);
buffer.SetRenderTarget(dirShadowAtlasId, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store);
buffer.ClearRenderTarget(true, false, Color.clear);
buffer.BeginSample(bufferName);
ExecuteBuffer();
int tiles = shadowedDirectionalLightCount * shadowSettings.directional.cascadeCount;
int split = tiles <= 1 ? 1 : tiles <= 4 ? 2 : 4;
int tileSize = atlasSize / split;
for (int i = 0; i < shadowedDirectionalLightCount; i++)
{
RenderDirectionalShadows(i, split, tileSize);
}
buffer.SetGlobalInt(cascadeCountId, shadowSettings.directional.cascadeCount);
buffer.SetGlobalVectorArray(cascadeCullingSpheresId, cascadeCullingSpheres);
buffer.SetGlobalVectorArray(cascadeDataId, cascadeData);
buffer.SetGlobalMatrixArray(dirShadowMatricesId, dirShadowMatrices);
float f = 1f - shadowSettings.directional.cascadeFade;
buffer.SetGlobalVector(shadowDistanceFadeId, new Vector4(1f / shadowSettings.maxDistance, 1f / shadowSettings.distanceFade, 1f / (1f - f * f)));
// 设置关键字
SetKeyWords(directionalFilterKeywords, (int)shadowSettings.directional.filter - 1);
SetKeyWords(cascadeBlendKeywords, (int)shadowSettings.directional.cascadeBlend - 1);
// 传递图集大小和纹素大小
buffer.SetGlobalVector(shadowAtlasSizeId, new Vector4(atlasSize, 1f / atlasSize));
buffer.EndSample(bufferName);
ExecuteBuffer();
}
/// <summary>
/// 设置关键字
/// </summary>
void SetKeyWords(string[] keywords, int enabledIndex)
{
for (int i = 0; i < keywords.Length; i++)
{
if (i == enabledIndex)
{
buffer.EnableShaderKeyword(keywords[i]);
}
else
{
buffer.DisableShaderKeyword(keywords[i]);
}
}
}
/// <summary>
/// 渲染单个定向光源阴影
/// </summary>
/// <param name="index"></param>
/// <param name="split"></param>
/// <param name="tileSize"></param>
void RenderDirectionalShadows(int index, int split, int tileSize)
{
ShadowedDirectionalLight light = shadowedDirectionalLights[index];
var newShadowSettings = new ShadowDrawingSettings(cullingResults, light.visibleLightIndex);
int cascadeCount = shadowSettings.directional.cascadeCount;
int tileOffset = index * cascadeCount;
Vector3 ratios = shadowSettings.directional.CascadeRatios;
float cullingFactor = Mathf.Max(0f, 0.8f - shadowSettings.directional.cascadeFade);
for (int i = 0; i < cascadeCount; i++)
{
cullingResults.ComputeDirectionalShadowMatricesAndCullingPrimitives(light.visibleLightIndex, i, cascadeCount, ratios, tileSize, light.nearPlaneOffset, out Matrix4x4 viewMatrix, out Matrix4x4 projectionMatrix, out ShadowSplitData splitData);
splitData.shadowCascadeBlendCullingFactor = cullingFactor;
newShadowSettings.splitData = splitData;
if (index == 0)
{
SetCascadeData(i, splitData.cullingSphere, tileSize);
}
int tileIndex = tileOffset + i;
SetTileViewport(index, split, tileSize);
dirShadowMatrices[tileIndex] = ConvertToAtlasMatrix(
projectionMatrix * viewMatrix,
SetTileViewport(tileIndex, split, tileSize),
split
);
buffer.SetViewProjectionMatrices(viewMatrix, projectionMatrix);
buffer.SetGlobalDepthBias(0f, light.slopeScaleBias);
ExecuteBuffer();
context.DrawShadows(ref newShadowSettings);
buffer.SetGlobalDepthBias(0f, 0f);
}
}
/// <summary>
/// 设置级联数据
/// </summary>
/// <param name="index"></param>
/// <param name="cullingSphere"></param>
/// <param name="tileSize"></param>
void SetCascadeData(int index, Vector4 cullingSphere, float tileSize)
{
float texelSize = 2f * cullingSphere.w / tileSize;
float fliterSize = texelSize * ((float)shadowSettings.directional.filter + 1f);
cullingSphere.w -= fliterSize;
cullingSphere.w *= cullingSphere.w;
cascadeCullingSpheres[index] = cullingSphere;
cascadeData[index] = new Vector4(
1f / cullingSphere.w,
fliterSize * 1.14142136f
);
}
/// <summary>
/// 设置视口的图块
/// </summary>
/// <param name="index"></param>
/// <param name="split"></param>
/// <param name="tileSize"></param>
/// <returns></returns>
Vector2 SetTileViewport(int index, int split, float tileSize)
{
Vector2 offset = new Vector2(index % split, index / split);
buffer.SetViewport(new Rect(offset.x * tileSize, offset.y * tileSize, tileSize, tileSize));
return offset;
}
/// <summary>
/// 得到从世界空间到阴影纹理图块空间的转换矩阵
/// </summary>
/// <param name="m"></param>
/// <param name="offset"></param>
/// <param name="split"></param>
/// <returns></returns>
Matrix4x4 ConvertToAtlasMatrix(Matrix4x4 m, Vector2 offset, int split)
{
if (SystemInfo.usesReversedZBuffer)
{
m.m20 = -m.m20;
m.m21 = -m.m21;
m.m22 = -m.m22;
m.m23 = -m.m23;
}
float scale = 1f / split;
m.m00 = (0.5f * (m.m00 + m.m30) + offset.x * m.m30) * scale;
m.m01 = (0.5f * (m.m01 + m.m31) + offset.x * m.m31) * scale;
m.m02 = (0.5f * (m.m02 + m.m32) + offset.x * m.m32) * scale;
m.m03 = (0.5f * (m.m03 + m.m33) + offset.x * m.m33) * scale;
m.m10 = (0.5f * (m.m10 + m.m30) + offset.y * m.m30) * scale;
m.m11 = (0.5f * (m.m11 + m.m31) + offset.y * m.m31) * scale;
m.m12 = (0.5f * (m.m12 + m.m32) + offset.y * m.m32) * scale;
m.m13 = (0.5f * (m.m13 + m.m33) + offset.y * m.m33) * scale;
m.m20 = 0.5f * (m.m20 + m.m30);
m.m21 = 0.5f * (m.m21 + m.m31);
m.m22 = 0.5f * (m.m22 + m.m32);
m.m23 = 0.5f * (m.m23 + m.m33);
return m;
}
/// <summary>
/// 释放申请的RT内存
/// </summary>
public void Cleanup()
{
buffer.ReleaseTemporaryRT(dirShadowAtlasId);
ExecuteBuffer();
}
}
fileFormatVersion: 2
guid: b5fd631dc4ef14bdc9ede96162808906
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7eb1a0578eb0ca940abef40cdf6bb122
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
// BRDF相关库
#ifndef CUSTOM_BRDF_INCLUDED
#define CUSTOM_BRDF_INCLUDED
// BRDF属性
struct BRDF
{
// 漫反射
float3 diffuse;
// 镜面反射
float3 specular;
// 粗糙度
float roughness;
};
// 电介质的反射率平均约0.04
#define MIN_REFLECTIVITY 0.04
// 计算不反射的值,将范围从 0-1 调整到 0-0.96,保持和URP中一样
float OneMinusReflectivity(float metallic)
{
float range = 1.0 - MIN_REFLECTIVITY;
return range - metallic * range;
}
// 获取表面的BRDF数据
BRDF GetBRDF(inout Surface surface, bool applyAlphaToDiffuse = false)
{
BRDF brdf;
float oneMinusReflectivity = OneMinusReflectivity(surface.metallic);
brdf.diffuse = surface.color * oneMinusReflectivity;
// 透明度预乘
if (applyAlphaToDiffuse)
{
brdf.diffuse *= surface.alpha;
}
brdf.specular = lerp(MIN_REFLECTIVITY, surface.color, surface.metallic);
// 光滑度转为实际粗糙度
float perceptualSmoothness = PerceptualSmoothnessToPerceptualRoughness(surface.smoothness);
brdf.roughness = PerceptualRoughnessToRoughness(perceptualSmoothness);
return brdf;
}
// 根据公式得到镜面反射强度
float SpecularStrength(Surface surface, BRDF brdf, Light light)
{
float3 h = SafeNormalize(light.direction + surface.viewDirection);
float nh2 = Square(saturate(dot(surface.normal, h)));
float lh2 = Square(saturate(dot(light.direction, h)));
float r2 = Square(brdf.roughness);
float d2 = Square(nh2 * (r2 - 1.0) + 1.00001);
float normalization = brdf.roughness * 4.0 + 2.0;
return r2 / (d2 * max(0.1, lh2) * normalization);
}
// 获取基于BRDF的直接照明
float3 DirectBRDF (Surface surface, BRDF brdf, Light light) {
return SpecularStrength(surface, brdf, light) * brdf.specular + brdf.diffuse;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: dda9dd1e15e8efa44b7b4c6c80775bd8
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 公共方法库
#ifndef CUSTOM_COMMON_INCLUDED
#define CUSTOM_COMMON_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "UnityInput.hlsl"
// 定义一些宏取代常用的转换矩阵
#define UNITY_MATRIX_M unity_ObjectToWorld
#define UNITY_MATRIX_I_M unity_WorldToObject
#define UNITY_MATRIX_V unity_MatrixV
#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"
// 获取值的平方
float Square(float x)
{
return x * x;
}
// 计算两点间距离的平方
float DistanceSquared(float3 pA, float3 pB)
{
return dot(pA - pB, pA - pB);
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 8affe3d00ecf5d04ebb205a1b24c2dce
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 全局照明相关库
#ifndef CUSTOM_GI_INCLUDED
#define CUSTOM_GI_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl"
TEXTURE2D(unity_Lightmap);
SAMPLER(samplerunity_Lightmap);
TEXTURE3D_FLOAT(unity_ProbeVolumeSH);
SAMPLER(samplerunity_ProbeVolumeSH);
TEXTURE2D(unity_ShadowMask);
SAMPLER(samplerunity_ShadowMask);
// 当需要渲染光照贴图对象时
#if defined(LIGHTMAP_ON)
#define GI_ATTRIBUTE_DATA float2 lightMapUV : TEXCOORD1;
#define GI_VARYINGS_DATA float2 lightMapUV : VAR_LIGHT_MAP_UV;
#define TRANSFER_GI_DATA(input, output) output.lightMapUV = input.lightMapUV * unity_LightmapST.xy + unity_LightmapST.zw;
#define GI_FRAGMENT_DATA(input) input.lightMapUV
#else
// 否则这些宏都为空`
#define GI_ATTRIBUTE_DATA
#define GI_VARYINGS_DATA
#define TRANSFER_GI_DATA(input, output)
#define GI_FRAGMENT_DATA(input) 0.0
#endif
struct GI
{
// 漫反射颜色
float3 diffuse;
ShadowMask shadowMask;
};
// 采样光照贴图
float3 SampleLightMap(float2 lightMapUV)
{
#if defined(LIGHTMAP_ON)
return SampleSingleLightmap(
TEXTURE2D_ARGS(unity_Lightmap, samplerunity_Lightmap), lightMapUV,
float4(1.0, 1.0, 0.0, 0.0),
#if defined(UNITY_LIGHTMAP_FULL_HDR)
false,
#else
true,
#endif
float4(LIGHTMAP_HDR_MULTIPLIER, LIGHTMAP_HDR_EXPONENT, 0.0, 0.0)
);
#else
return 0.0;
#endif
}
// 采样光照探针
float3 SampleLightProbe(Surface surfaceWS)
{
#if defined(LIGHTMAP_ON)
return 0.0;
#else
// 判断是否使用LPPV或差值光照探针
if (unity_ProbeVolumeParams.x)
{
return SampleProbeVolumeSH4(
TEXTURE3D_ARGS(unity_ProbeVolumeSH, samplerunity_ProbeVolumeSH),
surfaceWS.position, surfaceWS.normal,
unity_ProbeVolumeWorldToObject,
unity_ProbeVolumeParams.y, unity_ProbeVolumeParams.z,
unity_ProbeVolumeMin.xyz, unity_ProbeVolumeSizeInv.xyz
);
}
else
{
float4 coefficients[7];
coefficients[0] = unity_SHAr;
coefficients[1] = unity_SHAg;
coefficients[2] = unity_SHAb;
coefficients[3] = unity_SHBr;
coefficients[4] = unity_SHBg;
coefficients[5] = unity_SHBb;
coefficients[6] = unity_SHC;
return max(0.0, SampleSH9(coefficients, surfaceWS.normal));
}
#endif
}
// 采样灯光遮挡探针
float4 SampleLightProbeOcclusion()
{
return unity_ProbesOcclusion;
}
// 采样shadowMask得到烘焙阴影数据
float4 SampleBakedShadows(float2 lightMapUV, Surface surfaceWS)
{
#if defined(LIGHTMAP_ON)
return SAMPLE_TEXTURE2D(unity_ShadowMask, samplerunity_ShadowMask, lightMapUV);
#else
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
}
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_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, surfaceWS);
#endif
return gi;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 172451413b465f34786bae0116837245
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 灯光数据相关库
#ifndef CUSTOM_LIGHT_INCLUDED
#define CUSTOM_LIGHT_INCLUDED
#define MAX_DIRECTIONAL_LIGHT_COUNT 4
CBUFFER_START(_CustomLight)
int _DirectionalLightCount;
// 定向光源颜色、方向、阴影等数据
float4 _DirectionalLightColors[MAX_DIRECTIONAL_LIGHT_COUNT];
float4 _DirectionalLightDirections[MAX_DIRECTIONAL_LIGHT_COUNT];
float4 _DirectionalLightShadowData[MAX_DIRECTIONAL_LIGHT_COUNT];
CBUFFER_END
// 灯光的属性
struct Light
{
// 颜色
float3 color;
// 方向
float3 direction;
float attenuation;
};
// 获取方向光源的数量
int GetDirectionalLightCount()
{
return _DirectionalLightCount;
}
DirectionalShadowData GetDirectionalShadowData(int lightIndex, ShadowData shadowData)
{
DirectionalShadowData data;
data.strength = _DirectionalLightShadowData[lightIndex].x;
data.tileIndex = _DirectionalLightShadowData[lightIndex].y + shadowData.cascadeIndex;
data.normalBias = _DirectionalLightShadowData[lightIndex].z;
data.shadowMaskChannel = _DirectionalLightShadowData[lightIndex].w;
return data;
}
// 获取目标索引定向光的属性
Light GetDirectionalLight(int index, Surface surfaceWS, ShadowData shadowData)
{
Light light;
light.color = _DirectionalLightColors[index].rgb;
light.direction = _DirectionalLightDirections[index].xyz;
DirectionalShadowData dirShadowData = GetDirectionalShadowData(index, shadowData);
light.attenuation = GetDirectionalShadowAttenuation(dirShadowData, shadowData, surfaceWS);
return light;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 02fdfa9fa783df346a5e57ca14275e5e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 光照计算相关库
#ifndef CUSTOM_LIGHTING_INCLUDED
#define CUSTOM_LIGHTING_INCLUDED
// 计算入射光照
float3 IncomingLight(Surface surface, Light light)
{
return saturate(dot(surface.normal, light.direction) * light.attenuation) * light.color;
}
// 入射光乘以光照照射到表面的直接照明颜色,得到最终的照明颜色
float3 GetLighting(Surface surface, BRDF brdf, Light light)
{
return IncomingLight(surface, light) * DirectBRDF(surface, brdf, light);
}
// 根据物体的表面信息和灯光属性获取最终光照结果
float3 GetLighting(Surface surfaceWS, BRDF brdf, GI gi)
{
// 得到表面阴影数据
ShadowData shadowData = GetShadowData(surfaceWS);
shadowData.shadowMask = gi.shadowMask;
// 可见光的光照结果进行累加得到最终光照结果
float3 color = gi.diffuse * brdf.diffuse;
for (int i = 0; i < GetDirectionalLightCount(); i++)
{
Light light = GetDirectionalLight(i, surfaceWS, shadowData);
color += GetLighting(surfaceWS, brdf, light);
}
return color;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: a6c7860b1963c2a4983cfc471820dbfd
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 阴影采样相关库
#ifndef CUSTOM_SHADOWS_INCLUDED
#define CUSTOM_SHADOWS_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl"
// 如果使用的是PCF 3X3
#if defined(_DIRECTIONAL_PCF3)
// 需要4个过滤器样本
#define DIRECTIONAL_FILTER_SAMPLES 4
#define DIRECTIONAL_FILTER_SETUP SampleShadow_ComputeSamples_Tent_3x3
#elif defined(_DIRECTIONAL_PCF5)
#define DIRECTIONAL_FILTER_SAMPLES 9
#define DIRECTIONAL_FILTER_SETUP SampleShadow_ComputeSamples_Tent_5x5
#elif defined(_DIRECTIONAL_PCF7)
#define DIRECTIONAL_FILTER_SAMPLES 16
#define DIRECTIONAL_FILTER_SETUP SampleShadow_ComputeSamples_Tent_7x7
#endif
#define MAX_SHADOWED_DIRECTIONAL_LIGHT_COUNT 4
#define MAX_CASCADE_COUNT 4
// 阴影图集
TEXTURE2D_SHADOW(_DirectionalShadowAtlas);
#define SHADOW_SAMPLER sampler_linear_clamp_compare
SAMPLER_CMP(SHADOW_SAMPLER);
CBUFFER_START(_CustomShadows)
// 级联数量
int _CascadeCount;
// 级联包围球数据
float4 _CascadeCullingSpheres[MAX_CASCADE_COUNT];
// 级联数据
float4 _CascadeData[MAX_CASCADE_COUNT];
// 阴影转换矩阵
float4x4 _DirectionalShadowMatrices[MAX_SHADOWED_DIRECTIONAL_LIGHT_COUNT * MAX_CASCADE_COUNT];
// 图集大小
float4 _ShadowAtlasSize;
// 阴影过渡距离
float4 _ShadowDistanceFade;
CBUFFER_END
// 定向光阴影的数据信息
struct DirectionalShadowData
{
float strength;
int tileIndex;
// 法线偏差
float normalBias;
int shadowMaskChannel;
};
// 烘焙阴影数据
struct ShadowMask
{
bool always;
bool distance;
float4 shadows;
};
// 表面的阴影数据
struct ShadowData
{
int cascadeIndex;
// 是否采样阴影的标识
float strength;
// 混合级联
float cascadeBlend;
ShadowMask shadowMask;
};
// 采样阴影图集
float SampleDirectionalShadowAtlas(float3 positionSTS)
{
return SAMPLE_TEXTURE2D_SHADOW(
_DirectionalShadowAtlas, SHADOW_SAMPLER, positionSTS
);
}
// PCF滤波采样定向光阴影
float FilterDirectionalShadow(float3 positionSTS)
{
#if defined(DIRECTIONAL_FILTER_SETUP)
// 样本权重
float weights[DIRECTIONAL_FILTER_SAMPLES];
// 样本位置
float2 positions[DIRECTIONAL_FILTER_SAMPLES];
float4 size = _ShadowAtlasSize.yyxx;
DIRECTIONAL_FILTER_SETUP(size, positionSTS.xy, weights, positions);
float shadow = 0;
for (int i = 0; i < DIRECTIONAL_FILTER_SAMPLES; i++)
{
// 遍历所有样本滤波得到权重和
shadow += weights[i] * SampleDirectionalShadowAtlas(
float3(positions[i].xy, positionSTS.z)
);
}
return shadow;
#else
return SampleDirectionalShadowAtlas(positionSTS);
#endif
}
// 获取烘焙阴影的衰减值
float GetBakedShadow(ShadowMask mask, int channel)
{
float shadow = 1.0;
if (mask.always || mask.distance)
{
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(
_DirectionalShadowMatrices[directional.tileIndex],
float4(surfaceWS.position + normalBias, 1.0)
).xyz;
float shadow = FilterDirectionalShadow(positionSTS);
// 如果级联混合小于1代表在级联层级过渡区域中,必须从下一个级联中采样并在两个值之间进行插值
if (global.cascadeBlend < 1.0)
{
normalBias = surfaceWS.normal * (directional.normalBias * _CascadeData[global.cascadeBlend + 1].y);
positionSTS = mul(
_DirectionalShadowMatrices[directional.tileIndex + 1],
float4(surfaceWS.position + normalBias, 1.0)
).xyz;
shadow = lerp(FilterDirectionalShadow(positionSTS), shadow, global.cascadeBlend);
}
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;
}
// 公式计算阴影过渡时的强度
float FadedShadowStrength(float distance, float scale, float fade)
{
return saturate((1.0 - distance * scale) * fade);
}
// 获取世界空间的表面阴影数据
ShadowData GetShadowData(Surface surfaceWS)
{
ShadowData data;
data.shadowMask.always= false;
data.shadowMask.distance = false;
data.shadowMask.shadows = 1.0;
data.cascadeBlend = 1.0;
data.strength = FadedShadowStrength(surfaceWS.depth, _ShadowDistanceFade.x, _ShadowDistanceFade.y);
int i;
// 如果物体表面到球心的平方距离小于球体半径的平方,就说明该物体在这层级联包围球中,得到合适的级联层级索引
for (i = 0; i < _CascadeCount; i++)
{
float4 sphere = _CascadeCullingSpheres[i];
float distanceSqr = DistanceSquared(surfaceWS.position, sphere.xyz);
if (distanceSqr < sphere.w)
{
// 计算级联阴影的过度强度
float fade = FadedShadowStrength(distanceSqr, _CascadeData[i].x, _ShadowDistanceFade.z);
// 如果物体在最后一层级联中
if (i == _CascadeCount - 1)
{
data.strength *= fade;
}
else
{
data.cascadeBlend = fade;
}
break;
}
}
// 如果超出级联层数,不进行阴影采样
if (i == _CascadeCount)
{
data.strength = 0.0;
}
#if defined(_CASCADE_BLEND_DITHER)
else if (data.cascadeBlend < surfaceWS.dither)
{
i += 1;
}
#endif
#if !defined(_CASCADE_BLEND_SOFT)
data.cascadeBlend = 1.0;
#endif
data.cascadeIndex = i;
return data;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: c7d5fcbd6bd13b04da4785c60ca22495
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 表面信息相关库
#ifndef CUSTOM_SURFACE_INCLUDED
#define CUSTOM_SURFACE_INCLUDED
struct Surface
{
// 表面位置坐标
float3 position;
float3 normal;
float3 viewDirection;
// 表面深度
float depth;
float3 color;
float alpha;
float metallic;
float smoothness;
// 抖动属性
float dither;
};
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: ab8dce4b88eb72c4897fa48126f98ebd
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// Unity标准输入库
#ifndef CUSTOM_UNITY_INPUT_INCLUDED
#define CUSTOM_UNITY_INPUT_INCLUDED
CBUFFER_START(UnityPerDraw)
float4x4 unity_ObjectToWorld;
float4x4 unity_WorldToObject;
float4 unity_LODFade;
// 这个矩阵包含一些在这里我们不需要的转换信息
real4 unity_WorldTransformParams;
float4 unity_ProbesOcclusion;
float4 unity_LightmapST;
float4 unity_DynamicLightmapST;
float4 unity_SHAr;
float4 unity_SHAg;
float4 unity_SHAb;
float4 unity_SHBr;
float4 unity_SHBg;
float4 unity_SHBb;
float4 unity_SHC;
float4 unity_ProbeVolumeParams;
float4x4 unity_ProbeVolumeWorldToObject;
float4 unity_ProbeVolumeSizeInv;
float4 unity_ProbeVolumeMin;
CBUFFER_END
float4x4 unity_MatrixVP;
float4x4 unity_MatrixV;
float4x4 glstate_matrix_projection;
// 相机位置
float3 _WorldSpaceCameraPos;
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 963698e3dc3a5284994ab2ea9c2877d1
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 54920b50b42280f4faa13292bc839719
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Shader "Custom RP/Lit"
{
Properties
{
_BaseMap("Texture", 2D) = "white" {}
_BaseColor("Color", Color) = (0.5, 0.5, 0.5, 1.0)
// 透明度测试的阈值
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
[Toggle(_CLIPPING)] _Clipping ("Alpha Clipping", Float) = 0
// 是否接受投影
[Toggle(_RECEIVE_SHADOWS)] _ReceiveShadows ("Receive Shadows", Float) = 1
// 阴影模式
[KeywordEnum(On, Clip, Dither, Off)] _Shadows ("Shadows", Float) = 0
// 透明通道预乘
[Toggle(_PREMULTIPLY_ALPHA)] _PremulAlpha("Premultiply Alpha", Float) = 0
// 金属度和光滑度
_Metallic("Metallic", Range(0, 1)) = 0
_Smoothness("Smoothness", Range(0, 1)) = 0.5
// 自发光
[NoScaleOffset] _EmissionMap("Emission", 2D) = "white" {}
[HDR] _EmissionColor("Emission", Color) = (0.0, 0.0, 0.0, 0.0)
// 设置混合模式
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Src Blend", Float) = 1
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Dst Blend", Float) = 0
// 默认写入深度缓冲区
[Enum(Off, 0, On, 1)] _ZWrite ("Z Write", Float) = 1
[HideInInspector] _MainTex("Texture for Lightmap", 2D) = "white" {}
[HideInInspector] _Color("Color for Lightmap", Color) = (0.5, 0.5, 0.5, 1.0)
}
SubShader
{
HLSLINCLUDE
#include "../ShaderLibrary/Common.hlsl"
#include "LitInput.hlsl"
ENDHLSL
Pass
{
Tags
{
"LightMode" = "CustomLit"
}
// 定义混合模式
Blend [_SrcBlend] [_DstBlend]
// 是否写入深度
ZWrite [_ZWrite]
HLSLPROGRAM
#pragma target 3.5
#pragma shader_feature _CLIPPING
#pragma shader_feature _RECEIVE_SHADOWS
// 是否透明通道预乘
#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_ALWAYS _SHADOW_MASK_DISTANCE
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_instancing
#pragma vertex LitPassVertex
#pragma fragment LitPassFragment
// 插入相关HLSL代码
#include "LitPass.hlsl"
ENDHLSL
}
Pass
{
Tags
{
"LightMode" = "ShadowCaster"
}
ColorMask 0
HLSLPROGRAM
#pragma target 3.5
#pragma shader_feature _ _SHADOWS_CLIP _SHADOWS_DITHER
#pragma multi_compile_instancing
#pragma vertex ShadowCasterPassVertex
#pragma fragment ShadowCasterPassFragment
#include "ShadowCasterPass.hlsl"
ENDHLSL
}
Pass
{
Tags
{
"LightMode" = "Meta"
}
Cull Off
HLSLPROGRAM
#pragma target 3.5
#pragma vertex MetaPassVertex
#pragma fragment MetaPassFragment
#include "MetaPass.hlsl"
ENDHLSL
}
}
CustomEditor "CustomShaderGUI"
}
fileFormatVersion: 2
guid: 6848ac66b88696c4ea2f1389e0877b8e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
#ifndef CUSTOM_LIT_INPUT_INCLUDED
#define CUSTOM_LIT_INPUT_INCLUDED
TEXTURE2D(_BaseMap);
TEXTURE2D(_EmissionMap);
SAMPLER(sampler_BaseMap);
UNITY_INSTANCING_BUFFER_START(UnityPerMaterial)
UNITY_DEFINE_INSTANCED_PROP(float4, _BaseMap_ST)
UNITY_DEFINE_INSTANCED_PROP(float4, _BaseColor)
UNITY_DEFINE_INSTANCED_PROP(float4, _EmissionColor)
UNITY_DEFINE_INSTANCED_PROP(float, _Cutoff)
UNITY_DEFINE_INSTANCED_PROP(float, _Metallic)
UNITY_DEFINE_INSTANCED_PROP(float, _Smoothness)
UNITY_INSTANCING_BUFFER_END(UnityPerMaterial)
float2 TransformBaseUV(float2 baseUV)
{
// 计算缩放和偏移后的UV坐标
float4 baseST = UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _BaseMap_ST);
return baseUV * baseST.xy + baseST.zw;
}
float4 GetBase(float2 baseUV)
{
float4 map = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseUV);
// 通过UNITY_ACCESS_INSTANCED_PROP访问material属性
float4 color = UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _BaseColor);
return map * color;
}
float3 GetEmission(float2 baseUV)
{
float4 map = SAMPLE_TEXTURE2D(_EmissionMap, sampler_BaseMap, baseUV);
// 通过UNITY_ACCESS_INSTANCED_PROP访问material属性
float4 color = UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _EmissionColor);
return map.rgb * color.rgb;
}
float GetCutoff(float2 baseUV)
{
// 透明度低于阈值的片元进行舍弃
return UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _Cutoff);
}
float GetMetallic(float2 baseUV)
{
return UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _Metallic);
}
float GetSmoothness(float2 baseUV)
{
return UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _Smoothness);
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 69d7da49567b5224da7d86aa2f6732e4
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
#ifndef CUSTOM_LIT_PASS_INCLUDED
#define CUSTOM_LIT_PASS_INCLUDED
#include "../ShaderLibrary/Surface.hlsl"
#include "../ShaderLibrary/Shadows.hlsl"
#include "../ShaderLibrary/Light.hlsl"
#include "../ShaderLibrary/BRDF.hlsl"
#include "../ShaderLibrary/GI.hlsl"
#include "../ShaderLibrary/Lighting.hlsl"
// 顶点函数输入结构体
struct Attributes
{
float3 positionOS : POSITION;
float2 baseUV : TEXCOORD0;
// 表面法线
float3 normalOS : NORMAL;
GI_ATTRIBUTE_DATA
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 片元函数输入结构体
struct Varyings
{
float4 positionCS : SV_POSITION;
float3 positionWS: VAR_POSITION;
float2 baseUV : VAR_BASE_UV;
// 世界法线
float3 normalWS : VAR_NORMAL;
GI_ATTRIBUTE_DATA
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 顶点函数
Varyings LitPassVertex(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
// 使UnityPassVertex输出位置和索引,并复制索引
UNITY_TRANSFER_INSTANCE_ID(input, output);
TRANSFER_GI_DATA(input, output);
output.positionWS = TransformObjectToWorld(input.positionOS);
output.positionCS = TransformWorldToHClip(output.positionWS);
// 计算世界空间的法线
output.normalWS = TransformObjectToWorldNormal(input.normalOS);
// 计算缩放和偏移后的UV坐标
output.baseUV = TransformBaseUV(input.baseUV);
return output;
}
// 片元函数
float4 LitPassFragment(Varyings input) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(input);
float4 base = GetBase(input.baseUV);
#if defined(_CLIPPING)
// 透明度低于阈值的片元进行舍弃
clip(base.a - GetCutoff(input.baseUV));
#endif
// 定义一个surface并填充属性
Surface surface;
surface.position = input.positionWS;
surface.normal = normalize(input.normalWS);
// 得到视角方向
surface.viewDirection = normalize(_WorldSpaceCameraPos - input.positionWS);
surface.depth = -TransformWorldToView(input.positionWS).z;
surface.color = base.rgb;
surface.alpha = base.a;
surface.metallic = GetMetallic(input.baseUV);
surface.smoothness = GetSmoothness(input.baseUV);
// 计算抖动值
surface.dither = InterleavedGradientNoise(input.positionCS.xy, 0);
// 通过表面属性和BRDF计算最终光照结果
#if defined(_PREMULTIPLY_ALPHA)
BRDF brdf = GetBRDF(surface, true);
#else
BRDF brdf = GetBRDF(surface);
#endif
// 获取全局照明数据
GI gi = GetGI(GI_FRAGMENT_DATA(input), surface);
float3 color = GetLighting(surface, brdf, gi);
color += GetEmission(input.baseUV);
return float4(color, surface.alpha);
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 0a7dab52c92acc3438e7792caa536224
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
#ifndef CUSTOM_META_PASS_INCLUDED
#define CUSTOM_META_PASS_INCLUDED
#include "../ShaderLibrary/Surface.hlsl"
#include "../ShaderLibrary/Shadows.hlsl"
#include "../ShaderLibrary/Light.hlsl"
#include "../ShaderLibrary/BRDF.hlsl"
bool4 unity_MetaFragmentControl;
float unity_OneOverOutputBoost;
float unity_MaxOutputValue;
struct Attributes {
float3 positionOS : POSITION;
float2 baseUV : TEXCOORD0;
float2 lightMapUV : TEXCOORD1;
};
struct Varyings {
float4 positionCS : SV_POSITION;
float2 baseUV : VAR_BASE_UV;
};
Varyings MetaPassVertex(Attributes input)
{
Varyings output;
input.positionOS.xy = input.lightMapUV * unity_LightmapST.xy + unity_LightmapST.zw;
output.positionCS = TransformWorldToHClip(input.positionOS);
output.baseUV = TransformBaseUV(input.baseUV);
return output;
}
float4 MetaPassFragment(Varyings input) : SV_TARGET
{
float4 base = GetBase(input.baseUV);
Surface surface;
ZERO_INITIALIZE(Surface, surface);
surface.color = base.rgb;
surface.metallic = GetMetallic(input.baseUV);
surface.smoothness = GetSmoothness(input.baseUV);
BRDF brdf = GetBRDF(surface);
float4 meta = 0.0;
if (unity_MetaFragmentControl.x)
{
meta = float4(brdf.diffuse, 1.0);
meta.rgb += brdf.specular * brdf.roughness * 0.5;
meta.rgb = min(
PositivePow(meta.rgb, unity_OneOverOutputBoost), unity_MaxOutputValue
);
}
else if (unity_MetaFragmentControl.y)
{
meta = float4(GetEmission(input.baseUV), 1.0);
}
return meta;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: cbc7a501efec9804894a575cb1e8d0be
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
// 阴影投射器
#ifndef CUSTOM_SHADOW_CASTER_PASS_INCLUDED
#define CUSTOM_SHADOW_CASTER_PASS_INCLUDED
// 顶点函数输入结构体
struct Attributes
{
float3 positionOS : POSITION;
float2 baseUV : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 片元函数输入结构体
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 baseUV : VAR_BASE_UV;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 顶点函数
Varyings ShadowCasterPassVertex(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
// 使UnityPassVertex输出位置和索引,并复制索引
UNITY_TRANSFER_INSTANCE_ID(input, output);
float3 positionWS = TransformObjectToWorld(input.positionOS);
output.positionCS = TransformWorldToHClip(positionWS);
#if UNITY_REVERSED_Z
output.positionCS.z = min(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
#else
output.positionCS.z = max(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE);
#endif
// 计算缩放和偏移后的UV坐标
output.baseUV = TransformBaseUV(input.baseUV);
return output;
}
// 片元函数
void ShadowCasterPassFragment(Varyings input)
{
UNITY_SETUP_INSTANCE_ID(input);
float4 base = GetBase(input.baseUV);
#if defined(_SHADOWS_CLIP)
// 透明度低于阈值的片元进行舍弃
clip(base.a - GetCutoff(input.baseUV));
#elif defined(_SHADOWS_DITHER)
// 计算抖动值
float dither = InterleavedGradientNoise(input.positionCS.xy, 0);
clip(base.a - dither);
#endif
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: cf100188a4ff11e4081d3f693d2e2070
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
Shader "Custom RP/Unlit"
{
Properties
{
_BaseMap("Texture", 2D) = "white" {}
[HDR] _BaseColor("Color", Color) = (1.0, 1.0, 1.0, 1.0)
// 透明度测试的阈值
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
[Toggle(_CLIPPING)] _Clipping ("Alpha Clipping", Float) = 0
// 阴影模式
[KeywordEnum(On, Clip, Dither, Off)] _Shadows ("Shadows", Float) = 0
// 设置混合模式
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Src Blend", Float) = 1
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Dst Blend", Float) = 0
// 默认写入深度缓冲区
[Enum(Off, 0, On, 1)] _ZWrite ("Z Write", Float) = 1
}
SubShader
{
HLSLINCLUDE
#include "../ShaderLibrary/Common.hlsl"
#include "UnlitInput.hlsl"
ENDHLSL
Pass
{
// 定义混合模式
Blend [_SrcBlend] [_DstBlend]
// 是否写入深度
ZWrite [_ZWrite]
HLSLPROGRAM
#pragma shader_feature _CLIPPING
#pragma multi_compile_instancing
#pragma vertex UnlitPassVertex
#pragma fragment UnlitPassFragment
// 插入相关HLSL代码
#include "UnlitPass.hlsl"
ENDHLSL
}
Pass
{
Tags
{
"LightMode" = "ShadowCaster"
}
ColorMask 0
HLSLPROGRAM
#pragma target 3.5
#pragma shader_feature _ _SHADOWS_CLIP _SHADOWS_DITHER
#pragma multi_compile_instancing
#pragma vertex ShadowCasterPassVertex
#pragma fragment ShadowCasterPassFragment
#include "ShadowCasterPass.hlsl"
ENDHLSL
}
Pass
{
Tags
{
"LightMode" = "Meta"
}
Cull Off
HLSLPROGRAM
#pragma target 3.5
#pragma vertex MetaPassVertex
#pragma fragment MetaPassFragment
#include "MetaPass.hlsl"
ENDHLSL
}
}
CustomEditor "CustomShaderGUI"
}
fileFormatVersion: 2
guid: f9b6d8c713e140648abcabcb6381316f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
#ifndef CUSTOM_UNLIT_INPUT_INCLUDED
#define CUSTOM_UNLIT_INPUT_INCLUDED
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
UNITY_INSTANCING_BUFFER_START(UnityPerMaterial)
UNITY_DEFINE_INSTANCED_PROP(float4, _BaseMap_ST)
UNITY_DEFINE_INSTANCED_PROP(float4, _BaseColor)
UNITY_DEFINE_INSTANCED_PROP(float, _Cutoff)
UNITY_INSTANCING_BUFFER_END(UnityPerMaterial)
float2 TransformBaseUV(float2 baseUV)
{
// 计算缩放和偏移后的UV坐标
float4 baseST = UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _BaseMap_ST);
return baseUV * baseST.xy + baseST.zw;
}
float4 GetBase(float2 baseUV)
{
float4 baseMap = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseUV);
// 通过UNITY_ACCESS_INSTANCED_PROP访问material属性
float4 baseColor = UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _BaseColor);
return baseMap * baseColor;
}
float3 GetEmission(float2 baseUV)
{
return GetBase(baseUV).rgb;
}
float GetCutoff(float2 baseUV)
{
return UNITY_ACCESS_INSTANCED_PROP(UnityPerMaterial, _Cutoff);
}
float GetMetallic(float2 baseUV)
{
return 0.0;
}
float GetSmoothness(float2 baseUV)
{
return 0.0;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 526b4f3557307a64ba252a7d6c341b1f
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
#ifndef CUSTOM_UNLIT_PASS_INCLUDED
#define CUSTOM_UNLIT_PASS_INCLUDED
// 顶点函数输入结构体
struct Attributes
{
float3 positionOS : POSITION;
float2 baseUV : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 片元函数输入结构体
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 baseUV : VAR_BASE_UV;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
// 顶点函数
Varyings UnlitPassVertex(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
// 使UnityPassVertex输出位置和索引,并复制索引
UNITY_TRANSFER_INSTANCE_ID(input, output);
float3 positionWS = TransformObjectToWorld(input.positionOS);
output.positionCS = TransformWorldToHClip(positionWS);
output.baseUV = TransformBaseUV(input.baseUV);
return output;
}
// 片元函数
float4 UnlitPassFragment(Varyings input) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(input);
float4 baseMap = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.baseUV);
float4 base = GetBase(input.baseUV);
#if defined(_CLIPPING)
// 透明度低于阈值的片元进行舍弃
clip(base.a - GetCutoff(input.baseUV));
#endif
return base;
}
#endif
\ No newline at end of file
fileFormatVersion: 2
guid: 4995316860cf375428b5ebb1c0f63386
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
{
"dependencies": {
"com.unity.collab-proxy": "1.7.1",
"com.unity.ide.vscode": "1.2.3",
"com.unity.render-pipelines.universal": "11.0.0",
"com.unity.test-framework": "1.1.29",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.5.6",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.6.1",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}
{
"dependencies": {
"com.unity.collab-proxy": {
"version": "1.7.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0"
},
"url": "https://packages.unity.cn"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.ide.vscode": {
"version": "1.2.3",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.mathematics": {
"version": "1.2.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.render-pipelines.core": {
"version": "11.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.render-pipelines.universal": {
"version": "11.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.mathematics": "1.1.0",
"com.unity.render-pipelines.core": "11.0.0",
"com.unity.shadergraph": "11.0.0"
}
},
"com.unity.searcher": {
"version": "4.3.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.cn"
},
"com.unity.shadergraph": {
"version": "11.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "11.0.0",
"com.unity.searcher": "4.3.1"
}
},
"com.unity.test-framework": {
"version": "1.1.29",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.cn"
},
"com.unity.textmeshpro": {
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.cn"
},
"com.unity.timeline": {
"version": "1.5.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.cn"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.visualscripting": {
"version": "1.6.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.cn"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.uielementsnative": "1.0.0"
}
},
"com.unity.modules.uielementsnative": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!11 &1
AudioManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Volume: 1
Rolloff Scale: 1
Doppler Factor: 1
Default Speaker Mode: 2
m_SampleRate: 0
m_DSPBufferSize: 1024
m_VirtualVoiceCount: 512
m_RealVoiceCount: 32
m_SpatializerPlugin:
m_AmbisonicDecoderPlugin:
m_DisableAudio: 0
m_VirtualizeEffects: 1
m_RequestedDSPBufferSize: 1024
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册