浏览代码

update lens flare to use new cluster display terminology

/cinematic-demo-ME
etienne cella 5 年前
当前提交
26e63c1b
共有 6 个文件被更改,包括 417 次插入427 次删除
  1. 11
      Assets/ClusterDisplay/Scripts/CustomDepthBuffer.cs
  2. 808
      Assets/Scenes/Demo/Demo_LI_Sunset.unity
  3. 2
      Assets/Scripts/LensFlare/Shader/LensFlareHDRPAdditive.shader
  4. 19
      Assets/Scripts/LensFlare/Shader/LensFlareHDRPCommon.hlsl
  5. 2
      Assets/Scripts/LensFlare/Shader/LensFlareHDRPLerp.shader
  6. 2
      Assets/Scripts/LensFlare/Shader/LensFlareHDRPPremultiplied.shader

11
Assets/ClusterDisplay/Scripts/CustomDepthBuffer.cs


struct InstancedDrawArgs
{
public Mesh mesh;
public List<Matrix4x4> transforms; // TODO use arrays if we use CommandBuffer
public List<Matrix4x4> transforms; // TODO use arrays
}
List<InstancedDrawArgs> m_RenderingData = new List<InstancedDrawArgs>();

{
if (m_ShowDebugUI && m_DepthBuffer != null)
{
//GUI.DrawTexture(new Rect(0, 0, 256, 256), m_DepthBuffer);
GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), m_DepthBuffer);
}
}

{
float n = camera.nearClipPlane;
float f = camera.farClipPlane;
float scale = projectionMatrix[2, 3] / (f * n) * (f - n);
bool reverseZ = scale > 0;
float scale = projectionMatrix[2, 3] / (f * n) * (f - n);
bool reverseZ = scale > 0;
if (reverseZ)
return new Vector4(-1 + f / n, 1, -1 / f + 1 / n, 1 / f);

m_InstancingDataGenerationVisitor.PopulateRenderingData(m_RenderingData);
// TMP DEBUG
Debug.Log("INSTANCING RENDERING DATA:");
/*Debug.Log("INSTANCING RENDERING DATA:");
}
}*/
}
static void UpdateRenderingDataRecursive(Transform parent, InstancingDataGenerationVisitor visitor)

808
Assets/Scenes/Demo/Demo_LI_Sunset.unity


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!114 &153483933
MonoBehaviour:
--- !u!21 &134793425
Material:
serializedVersion: 6
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name:
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
rotation:
m_OverrideState: 0
m_Value: 333
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 1
exposure:
m_OverrideState: 0
m_Value: 0.5
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxColor:
m_OverrideState: 0
m_Value: {x: 0, y: 0, z: 0}
desiredLuxValue:
m_OverrideState: 0
m_Value: 8000
updateMode:
m_OverrideState: 0
m_Value: 0
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
hdriSky:
m_OverrideState: 0
m_Value: {fileID: 8900000, guid: 99edcc3e745602e4b9ea93bdcf66565b, type: 3}
enableBackplate:
m_OverrideState: 0
m_Value: 0
backplateType:
m_OverrideState: 0
m_Value: 0
groundLevel:
m_OverrideState: 0
m_Value: 0
scale:
m_OverrideState: 0
m_Value: {x: 32, y: 32}
projectionDistance:
m_OverrideState: 0
m_Value: 16
min: 0.0000001
plateRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexOffset:
m_OverrideState: 0
m_Value: {x: 0, y: 0}
blendAmount:
m_OverrideState: 0
m_Value: 0
min: 0
max: 100
shadowTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
pointLightShadow:
m_OverrideState: 0
m_Value: 0
dirLightShadow:
m_OverrideState: 0
m_Value: 0
rectLightShadow:
m_OverrideState: 0
m_Value: 0
m_Name: CustomRenderTexture/Scrolling_2layers
m_Shader: {fileID: 4800000, guid: e11971c35d6ca404b91aa52ef763e5eb, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Tex:
m_Texture: {fileID: 2800000, guid: 21efd174e67a1a8408fda6e0d637f109, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex2:
m_Texture: {fileID: 2800000, guid: 21efd174e67a1a8408fda6e0d637f109, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Speed: {r: 0.15, g: 0.02, b: 0.3, a: 0.02}
--- !u!1 &212868448
GameObject:
m_ObjectHideFlags: 0

Actions:
- Description: Select script
Target: {fileID: 11500000, guid: ad8473dd79162b84ba2db941e6113798, type: 3}
--- !u!86 &293755747
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 0
m_ColorFormat: 4
m_MipMap: 1
m_GenerateMips: 1
m_SRGB: 1
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_Dimension: 2
m_VolumeDepth: 1
m_Material: {fileID: 134793425}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 1, g: 1, b: 1, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 2
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_WrapUpdateZones: 0
--- !u!1 &496188744
GameObject:
m_ObjectHideFlags: 0

Actions:
- Description: Select Directional Light
Target: {fileID: 870159747}
--- !u!114 &520297763
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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name:
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
rotation:
m_OverrideState: 0
m_Value: 333
min: 0
max: 360
skyIntensityMode:
m_OverrideState: 0
m_Value: 1
exposure:
m_OverrideState: 0
m_Value: 0.5
multiplier:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxValue:
m_OverrideState: 0
m_Value: 1
min: 0
upperHemisphereLuxColor:
m_OverrideState: 0
m_Value: {x: 0, y: 0, z: 0}
desiredLuxValue:
m_OverrideState: 0
m_Value: 8000
updateMode:
m_OverrideState: 0
m_Value: 0
updatePeriod:
m_OverrideState: 0
m_Value: 0
min: 0
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
hdriSky:
m_OverrideState: 0
m_Value: {fileID: 8900000, guid: 99edcc3e745602e4b9ea93bdcf66565b, type: 3}
enableBackplate:
m_OverrideState: 0
m_Value: 0
backplateType:
m_OverrideState: 0
m_Value: 0
groundLevel:
m_OverrideState: 0
m_Value: 0
scale:
m_OverrideState: 0
m_Value: {x: 32, y: 32}
projectionDistance:
m_OverrideState: 0
m_Value: 16
min: 0.0000001
plateRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexRotation:
m_OverrideState: 0
m_Value: 0
min: 0
max: 360
plateTexOffset:
m_OverrideState: 0
m_Value: {x: 0, y: 0}
blendAmount:
m_OverrideState: 0
m_Value: 0
min: 0
max: 100
shadowTint:
m_OverrideState: 0
m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
pointLightShadow:
m_OverrideState: 0
m_Value: 0
dirLightShadow:
m_OverrideState: 0
m_Value: 0
rectLightShadow:
m_OverrideState: 0
m_Value: 0
--- !u!1 &598376747
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 867483365}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 17.384, y: 191.46399, z: -3.765}
--- !u!43 &627940058
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LensFlare (Flare01 (1))
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 12
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 4
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 24
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 8
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 36
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 12
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 48
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 16
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 60
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 20
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 72
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 24
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200020003000000040005000600060007000400080009000a000a000b0008000c000d000e000e000f000c00100011001200120013001000140015001600160017001400180019001a001a001b001800
m_VertexData:
serializedVersion: 3
m_VertexCount: 28
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 36
format: 0
dimension: 4
- stream: 0
offset: 52
format: 0
dimension: 4
- stream: 0
offset: 68
format: 0
dimension: 4
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 2352
_typelessdata: 000080bf000080bf000000009998983e9998183ea1a0a03d00000000000000000000803f00000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000009998983e9998183ea1a0a03d000000000000803f0000803f00000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000009998983e9998183ea1a0a03d000000000000803f0000000000000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000009998983e9998183ea1a0a03d00000000000000000000000000000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000e6b7ed3e1bcda73e39cf203e00000000000000000000803f0000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000e6b7ed3e1bcda73e39cf203e000000000000803f0000803f0000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000e6b7ed3e1bcda73e39cf203e000000000000803f000000000000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000e6b7ed3e1bcda73e39cf203e0000000000000000000000000000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf000000000ad7a33c0ad7233b0ad7233b00000000000000000000803fcdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000000ad7a33c0ad7233b0ad7233b000000000000803f0000803fcdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000000ad7a33c0ad7233b0ad7233b000000000000803f00000000cdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000000ad7a33c0ad7233b0ad7233b000000000000000000000000cdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf0000000024bc5f3c1bcd273d24bc5f3c00000000000000000000803f0000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf0000000024bc5f3c1bcd273d24bc5f3c000000000000803f0000803f0000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f0000000024bc5f3c1bcd273d24bc5f3c000000000000803f000000000000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f0000000024bc5f3c1bcd273d24bc5f3c0000000000000000000000000000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf000000002a9c933d3483b83d2a9c133c00000000000000000000803f6666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000002a9c933d3483b83d2a9c133c000000000000803f0000803f6666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000002a9c933d3483b83d2a9c133c000000000000803f000000006666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000002a9c933d3483b83d2a9c133c0000000000000000000000006666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000793fd93e4c5d943d19c13e3d00000000000000000000803f00000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000793fd93e4c5d943d19c13e3d000000000000803f0000803f00000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000793fd93e4c5d943d19c13e3d000000000000803f0000000000000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000793fd93e4c5d943d19c13e3d00000000000000000000000000000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000f1f0f03dc1c0c03c8180003c00000000000000000000803f000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000f1f0f03dc1c0c03c8180003c000000000000803f0000803f000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000f1f0f03dc1c0c03c8180003c000000000000803f00000000000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000f1f0f03dc1c0c03c8180003c000000000000000000000000000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 12, y: 12, z: 12}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimizationFlags: 1
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &762729547
GameObject:
m_ObjectHideFlags: 0

e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 2041828021}
m_Cookie: {fileID: 293755747}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1016416909}
m_Mesh: {fileID: 627940058}
m_Mesh: {fileID: 1874398892}
--- !u!114 &1016416914
MonoBehaviour:
m_ObjectHideFlags: 0

- {fileID: 4300012, guid: 9dcb662974bf65f46ac5d099aeb11c58, type: 3}
- {fileID: 4300050, guid: cd0c9b3e4cdc5834289b0e62821d0f17, type: 3}
m_RenderTargetSize: {x: 512, y: 512}
m_ShowDebugUI: 1
m_ShowDebugUI: 0
--- !u!1 &1310773822
GameObject:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
m_Profile: {fileID: 11400000, guid: 466752a7a2452cc4a9ec9be5d67c83b0, type: 2}
m_StaticLightingSkyUniqueID: 1
m_SkySettings: {fileID: 153483933}
m_SkySettings: {fileID: 520297763}
--- !u!21 &1396564832
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CustomRenderTexture/Scrolling_2layers
m_Shader: {fileID: 4800000, guid: e11971c35d6ca404b91aa52ef763e5eb, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Tex:
m_Texture: {fileID: 2800000, guid: 21efd174e67a1a8408fda6e0d637f109, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Tex2:
m_Texture: {fileID: 2800000, guid: 21efd174e67a1a8408fda6e0d637f109, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Speed: {r: 0.15, g: 0.02, b: 0.3, a: 0.02}
--- !u!1 &1459424988
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 867483365}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!43 &1874398892
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LensFlare (Flare01 (1))
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 12
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 4
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 24
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 8
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 36
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 12
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 48
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 16
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 60
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 20
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
- serializedVersion: 2
firstByte: 72
indexCount: 6
topology: 0
baseVertex: 0
firstVertex: 24
vertexCount: 4
localAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 1, y: 1, z: 0}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200020003000000040005000600060007000400080009000a000a000b0008000c000d000e000e000f000c00100011001200120013001000140015001600160017001400180019001a001a001b001800
m_VertexData:
serializedVersion: 3
m_VertexCount: 28
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 36
format: 0
dimension: 4
- stream: 0
offset: 52
format: 0
dimension: 4
- stream: 0
offset: 68
format: 0
dimension: 4
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 2352
_typelessdata: 000080bf000080bf000000009998983e9998183ea1a0a03d00000000000000000000803f00000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000009998983e9998183ea1a0a03d000000000000803f0000803f00000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000009998983e9998183ea1a0a03d000000000000803f0000000000000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000009998983e9998183ea1a0a03d00000000000000000000000000000000000000000000003f0000003f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000e6b7ed3e1bcda73e39cf203e00000000000000000000803f0000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000e6b7ed3e1bcda73e39cf203e000000000000803f0000803f0000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000e6b7ed3e1bcda73e39cf203e000000000000803f000000000000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000e6b7ed3e1bcda73e39cf203e0000000000000000000000000000000000000000000020400000004035f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf000000000ad7a33c0ad7233b0ad7233b00000000000000000000803fcdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000000ad7a33c0ad7233b0ad7233b000000000000803f0000803fcdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000000ad7a33c0ad7233b0ad7233b000000000000803f00000000cdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000000ad7a33c0ad7233b0ad7233b000000000000000000000000cdcc4c3f00003442cdcc4c3ecdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf0000000024bc5f3c1bcd273d24bc5f3c00000000000000000000803f0000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf0000000024bc5f3c1bcd273d24bc5f3c000000000000803f0000803f0000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f0000000024bc5f3c1bcd273d24bc5f3c000000000000803f000000000000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f0000000024bc5f3c1bcd273d24bc5f3c0000000000000000000000000000803f00003442cdcccc3dcdcccc3d35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf000000002a9c933d3483b83d2a9c133c00000000000000000000803f6666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf000000002a9c933d3483b83d2a9c133c000000000000803f0000803f6666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f000000002a9c933d3483b83d2a9c133c000000000000803f000000006666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f000000002a9c933d3483b83d2a9c133c0000000000000000000000006666e63f000080bf0000803f0000803f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000793fd93e4c5d943d19c13e3d00000000000000000000803f00000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000793fd93e4c5d943d19c13e3d000000000000803f0000803f00000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000793fd93e4c5d943d19c13e3d000000000000803f0000000000000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000793fd93e4c5d943d19c13e3d00000000000000000000000000000040000080bf9a99993f9a99993f35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf000080bf00000000f1f0f03dc1c0c03c8180003c00000000000000000000803f000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f000080bf00000000f1f0f03dc1c0c03c8180003c000000000000803f0000803f000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c450000803f0000803f00000000f1f0f03dc1c0c03c8180003c000000000000803f00000000000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45000080bf0000803f00000000f1f0f03dc1c0c03c8180003c000000000000000000000000000000000000000000009040cdcc4c3e35f2dd4251441a437a77f043000040410000803f0000404000401c4500501c45
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 12, y: 12, z: 12}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimizationFlags: 1
m_StreamData:
offset: 0
size: 0
path:
--- !u!4 &1947574694 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4783020418436320, guid: d6d76942c68024a4e841e73d8aff2174,

m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!86 &2041828021
CustomRenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 0
m_ColorFormat: 4
m_MipMap: 1
m_GenerateMips: 1
m_SRGB: 1
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_Dimension: 2
m_VolumeDepth: 1
m_Material: {fileID: 1396564832}
m_InitSource: 0
m_InitMaterial: {fileID: 0}
m_InitColor: {r: 1, g: 1, b: 1, a: 1}
m_InitTexture: {fileID: 0}
m_UpdateMode: 1
m_InitializationMode: 2
m_UpdateZoneSpace: 0
m_CurrentUpdateZoneSpace: 0
m_UpdateZones: []
m_UpdatePeriod: 0
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_WrapUpdateZones: 0
--- !u!1001 &2048262197
PrefabInstance:
m_ObjectHideFlags: 0

2
Assets/Scripts/LensFlare/Shader/LensFlareHDRPAdditive.shader


#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "LensFlareHDRPCommon.hlsl"
#pragma multi_compile __ USING_GLOBAL_SCREEN_SPACE
#pragma multi_compile __ USING_CLUSTER_DISPLAY
float4 frag (v2f i) : SV_Target
{

19
Assets/Scripts/LensFlare/Shader/LensFlareHDRPCommon.hlsl


#include "Packages\com.unity.render-pipelines.high-definition\Runtime\ShaderLibrary\GlobalScreenSpace.hlsl"
#include "Packages\com.unity.render-pipelines.high-definition\Runtime\ShaderLibrary\ClusterDisplay.hlsl"
struct appdata
{

if (pos.x >= 0 && pos.x <= 1 && pos.y >= 0 && pos.y <= 1)
{
#if defined(USING_GLOBAL_SCREEN_SPACE)
#if defined(USING_CLUSTER_DISPLAY)
float sampledDepth = LinearEyeDepth(tex2Dlod(_CustomDepthTex, float4(pos, 0, 0)).r, _CustomDepthZBufferParams);
#else
float sampledDepth = LinearEyeDepth(SampleCameraDepth(pos), _ZBufferParams);

float4 extent = TransformWorldToHClip(GetCameraRelativePositionWS(v.worldPosRadius.xyz + cameraUp * v.worldPosRadius.w));
#if defined(USING_GLOBAL_SCREEN_SPACE)
float2 screenPos = CLIP_SPACE_GLOBAL(clip.xy / clip.w);
float2 extentPos = CLIP_SPACE_GLOBAL(extent.xy / extent.w);
#else
float2 screenPos = clip.xy / clip.w;
float2 extentPos = extent.xy / extent.w;
#endif
float2 screenPos = DEVICE_TO_CLUSTER_NORMALIZED_COORDINATES(clip.xy / clip.w);
float2 extentPos = DEVICE_TO_CLUSTER_NORMALIZED_COORDINATES(extent.xy / extent.w);
float radius = distance(screenPos, extentPos);

float2 rayOffset = -screenPos * v.lensflare_data.x;
o.vertex.w = v.vertex.w;
#if defined(USING_GLOBAL_SCREEN_SPACE)
o.vertex.xy = CLIP_SPACE_LOCAL(screenPos + local + rayOffset);
#else
o.vertex.xy = screenPos + local + rayOffset;
#endif
o.vertex.xy = CLUSTER_TO_DEVICE_NORMALIZED_COORDINATES(screenPos + local + rayOffset);
o.vertex.z = 1;
o.uv = v.uv;

2
Assets/Scripts/LensFlare/Shader/LensFlareHDRPLerp.shader


#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "LensFlareHDRPCommon.hlsl"
#pragma multi_compile __ USING_GLOBAL_SCREEN_SPACE
#pragma multi_compile __ USING_CLUSTER_DISPLAY
float4 frag (v2f i) : SV_Target
{

2
Assets/Scripts/LensFlare/Shader/LensFlareHDRPPremultiplied.shader


#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "LensFlareHDRPCommon.hlsl"
#pragma multi_compile __ USING_GLOBAL_SCREEN_SPACE
#pragma multi_compile __ USING_CLUSTER_DISPLAY
float4 frag (v2f i) : SV_Target
{

正在加载...
取消
保存