add lloit

This commit is contained in:
StarBeats 2026-02-02 15:26:23 +08:00
parent 80349e71d0
commit 5d3b01ec25
38 changed files with 1431 additions and 24 deletions

View File

@ -20,7 +20,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: fish_red_tail_barracuda_mat 2 m_Name: fish_red_tail_barracuda_mat_ll
m_Shader: {fileID: 4800000, guid: 5626fadf5ea58ad448d468c2362fadfb, type: 3} m_Shader: {fileID: 4800000, guid: 5626fadf5ea58ad448d468c2362fadfb, type: 3}
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 683236fe3d410e844ac653335bde05c6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,281 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8776938483731093280
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: fish_red_tail_barracuda_mat_wb
m_Shader: {fileID: 4800000, guid: 5626fadf5ea58ad448d468c2362fadfb, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _SURFACE_TYPE_TRANSPARENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BarkBaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BarkMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BarkNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 2800000, guid: bbbcb3955239d7044802403ff081d4b7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: f60b17854821a8e4f8db8f5bc6e8dbc3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CausticsTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DamagedMap:
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}
- _LayerMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: bbbcb3955239d7044802403ff081d4b7, 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}
- _RainMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ReflectionCube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RoughnessMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SmoothnessNoiseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TrunkBaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TrunkMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TrunkNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- g_GustNoise:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Alpha: 1
- _AlphaClip: 0.05
- _AlphaToMask: 0
- _AnisoTroyPower: 1
- _Anisotropy: 4
- _AnisotropyRotate: 180
- _BackSSSIntensity: 1
- _BackSubsurfaceDistorin: 0.5
- _BarkAORemapMax: 1
- _BarkAORemapMin: 0
- _BarkMetallic: 1
- _BarkNormalScale: 1
- _BarkSmoothnessRemapMax: 1
- _BarkSmoothnessRemapMin: 0
- _BarkUseUV3: 1
- _Blend: 0
- _BlendMode: 0
- _BlendModePreserveSpecular: 0
- _BlendOp: 0
- _BumpScale: 1
- _CausticsScale: 1
- _CausticsSpeed: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _CustomCube: 0
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _Drag: 1
- _DstAlphaBlend: 0
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EnableAnisotropy: 0
- _EnableCaustics: 0
- _EnableDamagedMap: 0
- _EnableDither: 0
- _EnableFade: 0
- _EnableFogMix: 1
- _EnableRainEffect: 0
- _EnableRebuildTBN: 0
- _EnableWind: 0
- _EnvironmentReflections: 1
- _FadeDistance: 1
- _FadeEnd: 100
- _FadeStart: 0
- _FrontSSSIntensity: 1
- _FrontSubsurfaceDistorin: 0.5
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _HeightDrag: 0
- _InitialBend: 0
- _InnerColorPower: 1
- _Mask: 5
- _MaskFactor: 1
- _MaterialPresetMode: 0
- _Metallic: 0
- _NormalScale: 1
- _ObjectHeight: 0.5
- _ObjectRadius: 0.5
- _OcclusionPower: 1
- _OcclusionStrength: 1
- _Parallax: 0.005
- _PrimaryShift: -1
- _QueueControl: 0
- _QueueOffset: 0
- _RainFactor: 1
- _RampRange: 0.3
- _RecalculateWindNormals: 0
- _ReceiveShadows: 1
- _ReflectionPower: 0
- _SSSDiffIntensity: 0
- _SampleGI: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecBlend: 0.25
- _SpecularHighlights: 1
- _SpecularMultiplier: 32
- _SrcAlphaBlend: 1
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _Stiffness: 1
- _Surface: 1
- _TowardLightFactor: 0
- _TrunkAORemapMax: 1
- _TrunkAORemapMin: 0
- _TrunkMetallic: 1
- _TrunkNormalScale: 1
- _TrunkSmoothnessRemapMax: 1
- _TrunkSmoothnessRemapMin: 0
- _TurbulenceStrength: 1
- _Type: 1
- _UseVertexColor: 0
- _WindStrength: 1
- _WindVariation: 0.3
- _WorkflowMode: 0
- _ZTest: 2
- _ZWrite: 0
m_Colors:
- _AOMinMax: {r: 0, g: 1, b: 0, a: 1}
- _BackColor: {r: 0, g: 0, b: 0, a: 0}
- _BarkBaseColor: {r: 1, g: 1, b: 1, a: 0}
- _BarkBlendMaskTilingOffset: {r: 1, g: 1, b: 0, a: 0}
- _BarkTilingOffset: {r: 1, g: 1, b: 0, a: 0}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _CausticsColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FadeColor: {r: 1, g: 1, b: 1, a: 1}
- _MainColor: {r: 1, g: 1, b: 1, a: 1}
- _MetaAndSmoothMinMax: {r: 0, g: 1, b: 0, a: 1}
- _NewNormal: {r: 0, g: 0, b: 0, a: 0}
- _RampColor: {r: 1, g: 1, b: 1, a: 1}
- _ShadowColor: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Speed: {r: 0, g: 0, b: 0, a: 0}
- _SubsurfaceColor: {r: 0, g: 0, b: 0, a: 0}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
- _TrunkBaseColor: {r: 1, g: 1, b: 1, a: 0}
- _TrunkBendFactor: {r: 0, g: 0, b: 0, a: 0}
- _TrunkTilingOffset: {r: 1, g: 1, b: 0, a: 0}
m_BuildTextureStacks: []

View File

@ -0,0 +1,130 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1190511022201966889
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1906943565300815997}
- component: {fileID: 331615139486854101}
- component: {fileID: 8323731243611344970}
- component: {fileID: 6383931937497784131}
- component: {fileID: 7032049500334920635}
m_Layer: 0
m_Name: CubeGreen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1906943565300815997
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190511022201966889}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0.44048807, z: -0, w: 0.8977585}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2.8473, y: 2.8473, z: 2.8473}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: -52.270004, z: 0}
--- !u!33 &331615139486854101
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190511022201966889}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8323731243611344970
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190511022201966889}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 80a14d3602d00b1429ca8268f799a999, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!64 &6383931937497784131
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190511022201966889}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &7032049500334920635
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1190511022201966889}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c170d3f6c2a2a00458b485774d844277
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -549,6 +549,39 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 25210862} m_GameObject: {fileID: 25210862}
m_Mesh: {fileID: 1451443487313757394, guid: a0569c31be8fc4039a33e3ca90eb0c35, type: 3} m_Mesh: {fileID: 1451443487313757394, guid: a0569c31be8fc4039a33e3ca90eb0c35, type: 3}
--- !u!1 &31312179
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 31312180}
m_Layer: 0
m_Name: lloit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &31312180
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 31312179}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.6114617, y: -0.12151647, z: 0.593028}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 750999888}
- {fileID: 1534542424}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &41360446 --- !u!1001 &41360446
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -11115,12 +11148,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 656460944} m_GameObject: {fileID: 656460944}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.17, y: 0.89, z: -117.32} m_LocalPosition: {x: -0.55853826, y: 1.0115165, z: -117.913025}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 2128448439}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &668764990 --- !u!1001 &668764990
PrefabInstance: PrefabInstance:
@ -12360,13 +12393,119 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 742645875} m_GameObject: {fileID: 742645875}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.17, y: 0.89, z: -116.13} m_LocalPosition: {x: -0.55853826, y: 1.0115165, z: -116.72302}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 2128448439}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &750999887
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 750999888}
- component: {fileID: 750999891}
- component: {fileID: 750999890}
- component: {fileID: 750999889}
m_Layer: 0
m_Name: Quad (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &750999888
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 750999887}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.55853826, y: 1.0115165, z: -116.72302}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 31312180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &750999889
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 750999887}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &750999890
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 750999887}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 3c479088164a4ea4390b39adffbcba67, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &750999891
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 750999887}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &760015822 stripped --- !u!1 &760015822 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 124843582331875961, guid: c708a3b79cd542b42bbfedb17e213bc1, type: 3} m_CorrespondingSourceObject: {fileID: 124843582331875961, guid: c708a3b79cd542b42bbfedb17e213bc1, type: 3}
@ -23533,7 +23672,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &1479054985 --- !u!4 &1479054985
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -24194,6 +24333,112 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1895808927420028092, guid: 7cb78e83e6bfa414f972dedaff480361, type: 3} m_CorrespondingSourceObject: {fileID: 1895808927420028092, guid: 7cb78e83e6bfa414f972dedaff480361, type: 3}
m_PrefabInstance: {fileID: 1532156035} m_PrefabInstance: {fileID: 1532156035}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &1534542423
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1534542424}
- component: {fileID: 1534542427}
- component: {fileID: 1534542426}
- component: {fileID: 1534542425}
m_Layer: 0
m_Name: Quad (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1534542424
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1534542423}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.55853826, y: 1.0115165, z: -117.913025}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 31312180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!64 &1534542425
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1534542423}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1534542426
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1534542423}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 923b12030ca6693438dd1e1b6e848749, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1534542427
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1534542423}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &1536073359 --- !u!1001 &1536073359
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -33401,6 +33646,39 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1895808927420028092, guid: 75f86fecdd563124b8231b01cbee26c0, type: 3} m_CorrespondingSourceObject: {fileID: 1895808927420028092, guid: 75f86fecdd563124b8231b01cbee26c0, type: 3}
m_PrefabInstance: {fileID: 2127207049} m_PrefabInstance: {fileID: 2127207049}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &2128448438
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2128448439}
m_Layer: 0
m_Name: wboit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2128448439
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2128448438}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.6114617, y: -0.12151647, z: 0.593028}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 742645879}
- {fileID: 656460948}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2128473146 --- !u!1001 &2128473146
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -36045,8 +36323,8 @@ SceneRoots:
- {fileID: 219676304} - {fileID: 219676304}
- {fileID: 1187884597} - {fileID: 1187884597}
- {fileID: 2083859764} - {fileID: 2083859764}
- {fileID: 742645879}
- {fileID: 656460948}
- {fileID: 1335403879} - {fileID: 1335403879}
- {fileID: 1829397601} - {fileID: 1829397601}
- {fileID: 332117873} - {fileID: 332117873}
- {fileID: 2128448439}
- {fileID: 31312180}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7d13f457236332f4599c35a6db20a94d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,81 @@
Shader "Hidden/OIT/LLOITRender"
{
SubShader
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
}
Pass
{
ZTest Always
ZWrite Off
Cull Back
Blend Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 5.0
#pragma enable_d3d11_debug_symbols
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "LinkedListRendering.hlsl"
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(uint vertexID: SV_VertexID)
{
v2f o;
float2 uv = float2((vertexID << 1) & 2, vertexID & 2);
float4 pos = float4(uv * 2.0 - 1.0, UNITY_NEAR_CLIP_VALUE, 1.0);
#ifdef UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION
pos = ApplyPretransformRotation(pos);
#endif
#if UNITY_UV_STARTS_AT_TOP
uv = float2((vertexID << 1) & 2, 1.0 - (vertexID & 2));
#endif
o.vertex = pos;
o.uv = uv;
return o;
}
sampler2D _CameraColorTex_LLOIT;
void frag(v2f input, out half4 col : SV_Target, uint uSampleIndex: SV_SampleIndex)
{
float4 screenColor = tex2D(_CameraColorTex_LLOIT, input.uv);
col = renderLinkedList(screenColor, input.vertex.xy, uSampleIndex);
}
// gles、metal
// void frag(v2f input, inout half4 col : SV_Target, uint uSampleIndex: SV_SampleIndex)
// void frag(v2f input, inout half4 col : CoLoR, uint uSampleIndex: SV_SampleIndex)
// {
// col.b = 0;
// // col = renderLinkedList(col, input.uv, uSampleIndex);
// }
// RWTexture2D<float4> _CameraColorTex; // dx12 运行同时作为 rtv uav,但是 Unity 无法设置 uav
// void frag(v2f input, out half4 col : SV_Target, uint uSampleIndex: SV_SampleIndex)
// {
// float4 screenColor = _CameraColorTex[uint2(input.uv * _ScreenParams.xy)]; // tex2D(_MainTex, input.uv);
// col = renderLinkedList(screenColor, input.vertex.xy, uSampleIndex);
// }
// vulkan、metal unity 无法同时读写(vk 扩展 VK_EXT_rasterization_order_attachment_access)
// FRAMEBUFFER_INPUT_HALF(0);
// void frag(v2f input, out half4 col : SV_Target, uint uSampleIndex: SV_SampleIndex)
// {
// col = LOAD_FRAMEBUFFER_INPUT(0, input.vertex.xy);
// // col = renderLinkedList(col, input.uv, uSampleIndex);
// }
ENDHLSL
}
}
}

View File

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

View File

@ -0,0 +1,61 @@
Shader "OIT/LLOIT/LLOITSimpleTranspatent"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("MainTex", 2D) = "white" {}
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Pass
{
ZTest LEqual
ZWrite Off
ColorMask 0
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 4.5
#include "UnityCG.cginc"
#include "LinkedListCreation.hlsl"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
fixed4 _Color;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
[earlydepthstencil]
fixed4 frag (v2f i, uint uSampleIdx : SV_SampleIndex) : SV_Target
{
float4 col = tex2D(_MainTex, i.uv) * _Color;
createFragmentEntry(col, i.vertex.xyz, uSampleIdx);
return col;
}
ENDCG
}
}
}

View File

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

View File

@ -0,0 +1,45 @@
#ifndef OIT_LINKED_LIST_INCLUDED
#define OIT_LINKED_LIST_INCLUDED
#include "LinkedListStruct.hlsl"
RWStructuredBuffer<FragmentAndLinkBuffer_STRUCT> FLBuffer : register(u1);
RWByteAddressBuffer StartOffsetBuffer : register(u2);
// PackRGBA takes a float4 value and packs it into a UINT (8 bits / float)
uint PackRGBA(float4 unpackedInput)
{
uint4 u = (uint4)(saturate(unpackedInput) * 255 + 0.5);
uint packedOutput = (u.w << 24UL) | (u.z << 16UL) | (u.y << 8UL) | u.x;
return packedOutput;
}
uint PackDepthSampleIdx(float depth, uint uSampleIdx) {
uint d = (uint)(saturate(depth) * (pow(2, 24) - 1));
return d << 8UL | uSampleIdx;
}
// Z buffer to linear 0..1 depth
inline float OitLinear01Depth( float z )
{
return 1.0 / (_ZBufferParams.x * z + _ZBufferParams.y);
}
void createFragmentEntry(float4 col, float3 pos, uint uSampleIdx) {
//Retrieve current Pixel count and increase counter
uint uPixelCount = FLBuffer.IncrementCounter();
//calculate bufferAddress
uint uStartOffsetAddress = 4 * (_ScreenParams.x * (pos.y - 0.5) + (pos.x - 0.5));
uint uOldStartOffset;
StartOffsetBuffer.InterlockedExchange(uStartOffsetAddress, uPixelCount, uOldStartOffset);
//add new Fragment Entry in FragmentAndLinkBuffer
FragmentAndLinkBuffer_STRUCT Element;
Element.pixelColor = PackRGBA(col);
Element.uDepthSampleIdx = PackDepthSampleIdx(OitLinear01Depth(pos.z), uSampleIdx);
Element.next = uOldStartOffset;
FLBuffer[uPixelCount] = Element;
}
#endif // OIT_LINKED_LIST_INCLUDED

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0f24a0f245b408840b0b6dec4618915e
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,167 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
[DisallowMultipleRendererFeature("Per-pixel Linked List Order-Independent Transparency")]
public class LinkedListOITFeature : ScriptableRendererFeature
{
[Serializable]
class Settings
{
public RenderPassEvent RenderPassEvent = RenderPassEvent.AfterRenderingOpaques;
public ComputeShader ComputeShader;
public Shader Shader;
}
[SerializeField]
Settings settings;
LLOITPass pass;
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
var cam = renderingData.cameraData;
if (cam.cameraType != CameraType.Game && cam.cameraType != CameraType.SceneView)
{
return;
}
renderer.EnqueuePass(pass);
}
public override void Create()
{
pass = new(settings);
}
//public override bool SupportsNativeRenderPass()
//{
// return true;
//}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
pass.Dispose();
}
class LLOITPass : ScriptableRenderPass, IDisposable
{
private readonly ProfilingSampler profiler;
private readonly CommandBuffer commandBuffer;
private readonly Material linkedListMaterial;
private readonly Settings settings;
private static readonly int fragmentLinkBufferID = Shader.PropertyToID("FLBuffer");
private static readonly int startOffsetBufferID = Shader.PropertyToID("StartOffsetBuffer");
private static readonly int cameraColorTexID = Shader.PropertyToID("_CameraColorTex_LLOIT");
private const int MAX_SORTED_PIXELS = 8;
private int screenWidth, screenHeight;
private ComputeBuffer fragmentLinkBuffer;
private ComputeBuffer startOffsetBuffer;
private bool bufferValid = false;
public LLOITPass(Settings settings)
{
this.settings = settings;
profiler = new(nameof(LLOITPass));
commandBuffer = new CommandBuffer();
commandBuffer.name = profiler.name;
renderPassEvent = settings.RenderPassEvent;
linkedListMaterial = new Material(settings.Shader);
RenderPipelineManager.beginContextRendering += PreRender;
}
private void PreRender(ScriptableRenderContext context, List<Camera> list)
{
if (!bufferValid)
{
return;
}
var cmd = commandBuffer;
cmd.BeginSample("Clear OIT RandomWriteTarget");
settings.ComputeShader.GetKernelThreadGroupSizes(0, out var x, out var y, out var z);
int dispatchGroupSizeX = Mathf.CeilToInt(screenWidth / (float)x);
int dispatchGroupSizeY = Mathf.CeilToInt(screenHeight / (float)y);
cmd.SetComputeIntParam(settings.ComputeShader, "screenWidth", screenWidth);
cmd.SetComputeBufferParam(settings.ComputeShader, 0, startOffsetBufferID, startOffsetBuffer);
cmd.DispatchCompute(settings.ComputeShader, 0, dispatchGroupSizeX, dispatchGroupSizeY, 1);
cmd.SetRandomWriteTarget(1, fragmentLinkBuffer);
cmd.SetRandomWriteTarget(2, startOffsetBuffer);
cmd.EndSample("Clear OIT RandomWriteTarget");
context.ExecuteCommandBuffer(cmd);
cmd.Clear();
}
RTHandle destinationRT;
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
var cmd = commandBuffer;
{
using var scp = new ProfilingScope(cmd, profiler);
ref var cameraData = ref renderingData.cameraData;
var rdr = cameraData.renderer;
if (cameraData.camera.pixelWidth != screenWidth || screenHeight != cameraData.camera.pixelHeight)
{
screenWidth = cameraData.camera.pixelWidth;
screenHeight = cameraData.camera.pixelHeight;
fragmentLinkBuffer?.Dispose();
startOffsetBuffer?.Dispose();
int bufferSize = screenWidth * screenHeight * MAX_SORTED_PIXELS;
int bufferStride = sizeof(uint) * 3;
//this is the per pixel linked list on the gpu
fragmentLinkBuffer = new ComputeBuffer(bufferSize, bufferStride, ComputeBufferType.Counter);
int bufferSizeHead = screenWidth * screenHeight;
int bufferStrideHead = sizeof(uint);
//create buffer for addresses, this is the head of the linked list
startOffsetBuffer = new ComputeBuffer(bufferSizeHead, bufferStrideHead, ComputeBufferType.Raw);
linkedListMaterial.SetBuffer(fragmentLinkBufferID, fragmentLinkBuffer);
linkedListMaterial.SetBuffer(startOffsetBufferID, startOffsetBuffer);
bufferValid = true;
}
var desc = renderingData.cameraData.cameraTargetDescriptor;
desc.depthBufferBits = 0;
desc.sRGB = false;
//desc.memoryless = RenderTextureMemoryless.Color;
if(RenderingUtils.ReAllocateIfNeeded(ref destinationRT, desc, filterMode: FilterMode.Bilinear, name: "_CameraColorTex_LLOIT"))
{
cmd.SetGlobalTexture(cameraColorTexID, destinationRT);
}
cmd.ClearRandomWriteTargets();
if (SystemInfo.copyTextureSupport != CopyTextureSupport.None)
{
cmd.CopyTexture(rdr.cameraColorTargetHandle, destinationRT);
}
else
{
Blit(cmd, rdr.cameraColorTargetHandle, destinationRT);
}
cmd.SetRenderTarget(rdr.cameraColorTargetHandle, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store);
cmd.DrawProcedural(Matrix4x4.identity, linkedListMaterial, 0, MeshTopology.Triangles, 3);
}
context.ExecuteCommandBuffer(cmd);
cmd.Clear();
}
public void Dispose()
{
fragmentLinkBuffer?.Dispose();
startOffsetBuffer?.Dispose();
GameObject.DestroyImmediate(linkedListMaterial);
RenderPipelineManager.beginContextRendering -= PreRender;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2f83dd6eb48aa6848950f8a0f61a70de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,87 @@
#ifndef OIT_LINKED_LIST_INCLUDED
#define OIT_LINKED_LIST_INCLUDED
#include "LinkedListStruct.hlsl"
StructuredBuffer<FragmentAndLinkBuffer_STRUCT> FLBuffer : register(t0);
ByteAddressBuffer StartOffsetBuffer : register(t1);
// Unity's HLSL seems not to support dynamic array size, so we can only set this before compilation
#define MAX_SORTED_PIXELS 8
//https://github.com/GameTechDev/AOIT-Update/blob/master/OIT_DX11/AOIT%20Technique/AOIT.hlsl
// UnpackRGBA takes a uint value and converts it to a float4
float4 UnpackRGBA(uint packedInput)
{
float4 unpackedOutput;
uint4 p = uint4((packedInput & 0xFFUL),
(packedInput >> 8UL) & 0xFFUL,
(packedInput >> 16UL) & 0xFFUL,
(packedInput >> 24UL));
unpackedOutput = ((float4)p) / 255;
return unpackedOutput;
}
float UnpackDepth(uint uDepthSampleIdx) {
return (float)(uDepthSampleIdx >> 8UL) / (pow(2, 24) - 1);
}
uint UnpackSampleIdx(uint uDepthSampleIdx) {
return uDepthSampleIdx & 0xFFUL;
}
float4 renderLinkedList(float4 col, float2 pos, uint uSampleIndex)
{
// Fetch offset of first fragment for current pixel
uint uStartOffsetAddress = 4 * (_ScreenParams.x * (pos.y - 0.5) + (pos.x - 0.5));
uint uOffset = StartOffsetBuffer.Load(uStartOffsetAddress);
FragmentAndLinkBuffer_STRUCT SortedPixels[MAX_SORTED_PIXELS];
// Parse linked list for all pixels at this position
// and store them into temp array for later sorting
int nNumPixels = 0;
while (uOffset != 0)
{
// Retrieve pixel at current offset
FragmentAndLinkBuffer_STRUCT Element = FLBuffer[uOffset];
uint uSampleIdx = UnpackSampleIdx(Element.uDepthSampleIdx);
if (uSampleIdx == uSampleIndex)
{
SortedPixels[nNumPixels] = Element;
nNumPixels += 1;
}
uOffset = (nNumPixels >= MAX_SORTED_PIXELS) ? 0 : FLBuffer[uOffset].next;
}
// Sort pixels in depth
for (int i = 0; i < nNumPixels - 1; i++)
{
for (int j = i + 1; j > 0; j--)
{
float depth = UnpackDepth(SortedPixels[j].uDepthSampleIdx);
float previousElementDepth = UnpackDepth(SortedPixels[j - 1].uDepthSampleIdx);
if (previousElementDepth < depth)
{
FragmentAndLinkBuffer_STRUCT temp = SortedPixels[j - 1];
SortedPixels[j - 1] = SortedPixels[j];
SortedPixels[j] = temp;
}
}
}
// Rendering pixels
for (int k = 0; k < nNumPixels; k++)
{
// Retrieve next unblended furthermost pixel
float4 vPixColor = UnpackRGBA(SortedPixels[k].pixelColor);
// Manual blending between current fragment and previous one
col.rgb = lerp(col.rgb, vPixColor.rgb, vPixColor.a);
}
return col;
}
#endif // OIT_LINKED_LIST_INCLUDED

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f4e283790d6119d429847ad1e84ea8e1
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
#ifndef LINKED_LIST_STRUCT_INCLUDED
#define LINKED_LIST_STRUCT_INCLUDED
struct FragmentAndLinkBuffer_STRUCT
{
uint pixelColor;
uint uDepthSampleIdx;
uint next;
};
#endif // LINKED_LIST_STRUCT_INCLUDED

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2e5f86f8c165a6845b8106786d369092
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,11 @@
#pragma kernel ClearStartOffsetBuffer
// #pragma enable_d3d11_debug_symbols
RWByteAddressBuffer StartOffsetBuffer;
int screenWidth;
[numthreads(32, 32, 1)]
void ClearStartOffsetBuffer (uint3 id: SV_DispatchThreadID)
{
StartOffsetBuffer.Store(4 * (screenWidth * id.y + id.x), 0);
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eb30737736968d64e99cd6b7e2cc9efb
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit_LLOITSimpleTranspatent 1
m_Shader: {fileID: 4800000, guid: 8e32954102c0fc647a751090ef5e40be, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _Color: {r: 0, g: 1, b: 0, a: 0.5019608}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 923b12030ca6693438dd1e1b6e848749
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Unlit_LLOITSimpleTranspatent
m_Shader: {fileID: 4800000, guid: 8e32954102c0fc647a751090ef5e40be, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: []
m_Colors:
- _Color: {r: 1, g: 0, b: 0, a: 0.5019608}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3c479088164a4ea4390b39adffbcba67
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,48 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
[DisallowMultipleRendererFeature("Moment Based Order-Independent Transparency")]
public class MOITFeature : ScriptableRendererFeature
{
[Serializable]
class Settings
{
}
[SerializeField]
Settings settings;
MOITPass pass;
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
var cam = renderingData.cameraData;
if (cam.cameraType != CameraType.Game && cam.cameraType != CameraType.SceneView)
{
return;
}
renderer.EnqueuePass(pass);
}
public override void Create()
{
pass = new(settings);
}
class MOITPass : ScriptableRenderPass
{
private Settings settings;
public MOITPass(Settings settings)
{
this.settings = settings;
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4854a869b24c78844a4c077509f99b4f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +1,4 @@
Shader "Hidden/WBOIT/WBOITBlend" Shader "Hidden/OIT/WBOITBlend"
{ {
SubShader SubShader

View File

@ -6,7 +6,7 @@ using UnityEngine.Rendering;
using UnityEngine.Rendering.RendererUtils; using UnityEngine.Rendering.RendererUtils;
using UnityEngine.Rendering.Universal; using UnityEngine.Rendering.Universal;
[DisallowMultipleRendererFeature] [DisallowMultipleRendererFeature("Weighted Blended Order-Independent Transparency")]
public class WBOITFeature : ScriptableRendererFeature public class WBOITFeature : ScriptableRendererFeature
{ {
[Serializable] [Serializable]
@ -66,7 +66,7 @@ public class WBOITFeature : ScriptableRendererFeature
static readonly int accumTexID = Shader.PropertyToID("_AccumTex"); static readonly int accumTexID = Shader.PropertyToID("_AccumTex");
static readonly int revealageTexID = Shader.PropertyToID("_RevealageTex"); static readonly int revealageTexID = Shader.PropertyToID("_RevealageTex");
static readonly int cameraColorTex = Shader.PropertyToID("_CameraColorTex"); static readonly int cameraColorTexID = Shader.PropertyToID("_CameraColorTex");
RTHandle[] oitRTs = new RTHandle[2]; RTHandle[] oitRTs = new RTHandle[2];
RenderTargetIdentifier[] oitRtIds = new RenderTargetIdentifier[2]; RenderTargetIdentifier[] oitRtIds = new RenderTargetIdentifier[2];
@ -147,7 +147,7 @@ public class WBOITFeature : ScriptableRendererFeature
cmd.BeginSample("Blend"); cmd.BeginSample("Blend");
cmd.SetGlobalTexture(accumTexID, oitRTs[0]); cmd.SetGlobalTexture(accumTexID, oitRTs[0]);
cmd.SetGlobalTexture(revealageTexID, oitRTs[1]); cmd.SetGlobalTexture(revealageTexID, oitRTs[1]);
cmd.SetGlobalTexture(cameraColorTex, rdr.cameraColorTargetHandle); cmd.SetGlobalTexture(cameraColorTexID, rdr.cameraColorTargetHandle);
cmd.SetRenderTarget(destinationRT, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare); cmd.SetRenderTarget(destinationRT, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare);
cmd.DrawProcedural(Matrix4x4.identity, blendMaterial, 0, MeshTopology.Triangles, 3); cmd.DrawProcedural(Matrix4x4.identity, blendMaterial, 0, MeshTopology.Triangles, 3);

View File

@ -1,4 +1,4 @@
Shader "WBOIT/WBOITSimpleTranspatent" Shader "OIT/WBOIT/WBOITSimpleTranspatent"
{ {
Properties Properties
{ {

View File

@ -14,6 +14,23 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Active: 0 m_Active: 0
quality: 0 quality: 0
--- !u!114 &-8044648393505963816
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: 2f83dd6eb48aa6848950f8a0f61a70de, type: 3}
m_Name: LinkedListOITFeature
m_EditorClassIdentifier:
m_Active: 1
settings:
RenderPassEvent: 500
ComputeShader: {fileID: 7200000, guid: eb30737736968d64e99cd6b7e2cc9efb, type: 3}
Shader: {fileID: 4800000, guid: 2ba4f97dc3583ad428b061dcec16cf00, type: 3}
--- !u!114 &-8043853166483734676 --- !u!114 &-8043853166483734676
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -358,7 +375,8 @@ MonoBehaviour:
- {fileID: -5418649131825517062} - {fileID: -5418649131825517062}
- {fileID: -7143664486661302651} - {fileID: -7143664486661302651}
- {fileID: 654879339943129409} - {fileID: 654879339943129409}
m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3de228858dca8d12222716523fbf3439fdb7a327b7bff4bdd446ac59dfa966ffa88ca6373cd5da9013d6cff55ca297e5e908a7b3653203b82383b2141bb05fbe69aec5704e48e2763e90bc6ff9f19caa7686c79a6bb3bb89a50faad0fe75217cdb485d6fa85ff9adc9c41710d3c4a991609 - {fileID: -8044648393505963816}
m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3de228858dca8d12222716523fbf3439fdb7a327b7bff4bdd446ac59dfa966ffa88ca6373cd5da9013d6cff55ca297e5e908a7b3653203b82383b2141bb05fbe69aec5704e48e2763e90bc6ff9f19caa7686c79a6bb3bb89a50faad0fe75217cdb485d6fa85ff9adc9c41710d3c4a991609d8002992e8aa5b90
m_UseNativeRenderPass: 0 m_UseNativeRenderPass: 0
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
shaders: shaders:
@ -408,7 +426,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 791db3d002c63d1409813c72e53105ff, type: 3} m_Script: {fileID: 11500000, guid: 791db3d002c63d1409813c72e53105ff, type: 3}
m_Name: WBOITFeature m_Name: WBOITFeature
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Active: 1 m_Active: 0
settings: settings:
RenderPassEvent: 400 RenderPassEvent: 400
FilterSettings: FilterSettings:
@ -626,6 +644,20 @@ MonoBehaviour:
m_Name: FSR m_Name: FSR
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Active: 0 m_Active: 0
--- !u!114 &7433864712388500722
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: 6ee67e36f6958b74291994b4c2ba6007, type: 3}
m_Name: OrderIndependentTransparencyRenderer
m_EditorClassIdentifier:
m_Active: 1
Renderers: []
--- !u!114 &7541218312462517771 --- !u!114 &7541218312462517771
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1,5 +1,5 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:yousandi.cn,2023: %TAG !u! tag:unity3d.com,2011:
--- !u!114 &-4945649147701093469 --- !u!114 &-4945649147701093469
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -121,7 +121,7 @@ MonoBehaviour:
- {fileID: -2390300670611609275} - {fileID: -2390300670611609275}
- {fileID: -4945649147701093469} - {fileID: -4945649147701093469}
m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3dea31b90a74d865dbb m_RendererFeatureMap: bc3f630842f2e70dd6a559c442a94bfd4529d15534f2d3dea31b90a74d865dbb
m_UseNativeRenderPass: 0 m_UseNativeRenderPass: 1
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
shaders: shaders:
blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}

View File

@ -413,7 +413,7 @@ namespace UnityEngine.Rendering.Universal
m_OverriddenDepthStoreAction = true; m_OverriddenDepthStoreAction = true;
} }
internal void ConfigureInputAttachments(RTHandle input, bool isTransient = false) public void ConfigureInputAttachments(RTHandle input, bool isTransient = false)
{ {
m_InputAttachments[0] = input; m_InputAttachments[0] = input;
m_InputAttachmentIsTransient[0] = isTransient; m_InputAttachmentIsTransient[0] = isTransient;

View File

@ -96,7 +96,7 @@ namespace UnityEngine.Rendering.Universal.Internal
desc.depthBufferBits = 0; desc.depthBufferBits = 0;
m_Desc = desc; m_Desc = desc;
m_FilterMode = filterMode; m_FilterMode = filterMode;
m_Desc.enableRandomWrite = true;
m_A.msaa = m_Desc.msaaSamples; m_A.msaa = m_Desc.msaaSamples;
m_B.msaa = m_Desc.msaaSamples; m_B.msaa = m_Desc.msaaSamples;

View File

@ -526,7 +526,7 @@ namespace UnityEngine.Rendering.Universal
} }
} }
internal override bool SupportsNativeRenderPass() public override bool SupportsNativeRenderPass()
{ {
return m_Technique == DecalTechnique.GBuffer || m_Technique == DecalTechnique.ScreenSpace; return m_Technique == DecalTechnique.GBuffer || m_Technique == DecalTechnique.ScreenSpace;
} }

View File

@ -240,7 +240,7 @@ namespace UnityEngine.Experimental.Rendering.Universal
renderer.EnqueuePass(renderObjectsPass); renderer.EnqueuePass(renderObjectsPass);
} }
internal override bool SupportsNativeRenderPass() public override bool SupportsNativeRenderPass()
{ {
return true; return true;
} }

View File

@ -56,7 +56,7 @@ namespace UnityEngine.Rendering.Universal
/// <summary> /// <summary>
/// Override this method and return true if the feature should use the Native RenderPass API /// Override this method and return true if the feature should use the Native RenderPass API
/// </summary> /// </summary>
internal virtual bool SupportsNativeRenderPass() public virtual bool SupportsNativeRenderPass()
{ {
return false; return false;
} }