比较提交
合并到: unity-tech-cn:main
unity-tech-cn:/main
unity-tech-cn:/cinematic-demo-ME
unity-tech-cn:/feature-ME-dolly
unity-tech-cn:/release-2019.3
unity-tech-cn:/cluster-display
unity-tech-cn:/2019.4-LTS
unity-tech-cn:/2020.3-LTS
unity-tech-cn:/2020.3-fix-ui
unity-tech-cn:/main/ME
拉取从: unity-tech-cn:feature-ME-dolly
unity-tech-cn:/main
unity-tech-cn:/cinematic-demo-ME
unity-tech-cn:/feature-ME-dolly
unity-tech-cn:/release-2019.3
unity-tech-cn:/cluster-display
unity-tech-cn:/2019.4-LTS
unity-tech-cn:/2020.3-LTS
unity-tech-cn:/2020.3-fix-ui
unity-tech-cn:/main/ME
此合并请求有变更与目标分支冲突。
/Packages/manifest.json
/ProjectSettings/UnityConnectSettings.asset
/ProjectSettings/ProjectVersion.txt
/ProjectSettings/HDRPProjectSettings.asset
/Assets/HDRPDefaultResources/DefaultRenderingSettings.asset
/Assets/Prefabs/Gameplay/FirstPersonCharacter.prefab
/Assets/Resources/VirtualCameraManager.prefab
/Assets/UI/Textures/Loading_A.tga.meta
/Assets/Graph/GenericMaterials/Generic/Textures/Neutral_H.tga.meta
/Assets/Graph/GenericMaterials/Generic/Textures/Neutral_MSK.tga.meta
/Assets/Graph/GenericMaterials/Generic/Textures/Neutral_N.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_BC.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_H.exr.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_H.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_MSK.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_N.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_BC.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_H.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_MSK.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_N.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_BC.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_H.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_MSK.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_N.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_BC.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_H.exr.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_MSK.tga.meta
/Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_N.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_BC.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_H.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_MSK.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_N.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/Sprig_BC.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/Sprig_MSK.tga.meta
/Assets/Graph/GenericMaterials/Moss/Textures/Sprig_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_BC.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_H.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_MSK.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_BC.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_H.exr.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_MSK.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_BC.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_H.exr.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_MSK.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_BC.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_H.exr.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_MSK.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_A.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_N.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_BC.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_H.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_M.tga.meta
/Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_N.tga.meta
/Assets/Graph/Lighting/Decals/Textures/DC_puddle01_BC.tga.meta
/Assets/Graph/Lighting/Decals/Textures/DC_puddle01_M.tga.meta
/Assets/Graph/Lighting/Decals/Textures/DC_puddle01_N.tga.meta
/Assets/Graph/Lighting/Textures/CloudNoise_A.tga.meta
/Assets/Graph/Lighting/Textures/lantern_A.tga.meta
/Assets/Graph/Lighting/Textures/lantern_H.tga.meta
/Assets/Graph/Lighting/Textures/lantern_N.tga.meta
/Assets/Graph/Lighting/Textures/noise_A.tga.meta
/Assets/Graph/Models/Grounds/Textures/Background_BC.tga.meta
/Assets/Graph/Models/Grounds/Textures/Background_N.tga.meta
/Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_BC.tga.meta
/Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_H.tga.meta
/Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_MSK.tga.meta
/Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_N.tga.meta
/Assets/Graph/Models/Props/BigRoot/Textures/Roots_Layers.tga.meta
/Assets/Graph/Models/Props/Dragon/Textures/Dragon_BC.png.meta
/Assets/Graph/Models/Props/Dragon/Textures/Dragon_MSK.tga.meta
/Assets/Graph/Models/Props/Dragon/Textures/Dragon_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_011_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_011_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_011_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_011_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_011_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_01_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_01_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_01_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_01_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_01_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_02_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_02_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_02_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_02_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_02_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_03_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_03_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_03_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_03_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_03_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_04_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_04_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_04_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_04_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Deco_04_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone01_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone01_H.exr.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone01_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone01_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone01_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_05_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_05_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_05_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_05_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_05_N.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_06_BC.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_06_H.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_06_Layers.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_06_MSK.tga.meta
/Assets/Graph/Models/Props/Ground/Textures/Stone_06_N.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_01_BC.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_01_H.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_01_Layers.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_01_MSK.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_01_N.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_02_BC.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_02_H.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_02_Layers.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_02_MSK.tga.meta
/Assets/Graph/Models/Props/Roots/Textures/Root_02_N.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_01_BC.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_01_H.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_01_MSK.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_01_N.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_02_BC.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_02_H.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_02_MSK.tga.meta
/Assets/Graph/Models/Props/WoodPieces/Textures/WoodPiece_02_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock02_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock02_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock02_Layers.png.meta
/Assets/Graph/Models/Rocks/Textures/Rock02_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock02_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock03_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock03_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock03_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock03_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock03_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock04_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock04_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock04_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock04_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock04_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock05_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock05_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock05_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock05_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock05_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock06_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock06_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock06_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock06_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock06_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock07_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock07_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock07_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock07_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock07_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock08_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock08_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock08_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock08_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock08_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock09_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock09_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock09_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock09_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock09_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock10_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock10_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock10_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock10_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock10_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock11_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock11_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock11_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock11_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock11_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock12_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock12_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock12_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock12_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock12_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock13_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock13_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock13_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock13_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock13_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock14_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock14_H.exr.meta
/Assets/Graph/Models/Rocks/Textures/Rock14_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock14_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock14_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_15_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_15_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_15_Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_15_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_15_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_Dragon_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_Dragon_MSK.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_Dragon_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_Dragon__BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/Rock_Dragon__Layers.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD0_BC.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD0_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD0_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD1_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD1_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD2_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD2_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD3_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD3_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD4_H.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_LOD4_N.tga.meta
/Assets/Graph/Models/Rocks/Textures/StonePile2_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Bark_04_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Bark_04_H.tga.meta
/Assets/Graph/Models/Trees/Textures/Bark_04_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Bark_04_N.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_03_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_03_H.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_03_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_03_N.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_H.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Branches_N.tga.meta
/Assets/Graph/Models/Trees/Textures/Pine_Branches_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Pine_Branches_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Pine_Branches_N.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_01_Layers.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_01_Layers_H.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_01_Layers_N.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_02_Layers.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_02_Layers_H.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_02_Layers_N.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_03_Layers.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_03_Layers_H.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_03_Layers_N.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_04_Layers.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_05_Layers.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_H.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/SilverBirch_N.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_03_Trunk_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_03_Trunk_H.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_03_Trunk_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_03_Trunk_N.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_04_BC.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_04_H.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_04_MSK.tga.meta
/Assets/Graph/Models/Trees/Textures/Tree_04_N.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_01_02_N.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_01_BC.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_01_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_01_N.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_04_BC.tga.meta
/Assets/Graph/Models/Vegetation/Bush/Textures/Bush_04_N.tga.meta
/Assets/Graph/Models/Vegetation/Fern/Textures/Fern_01_BC.tga.meta
/Assets/Graph/Models/Vegetation/Fern/Textures/Fern_01_H.tga.meta
/Assets/Graph/Models/Vegetation/Fern/Textures/Fern_01_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Fern/Textures/Fern_01_N.tga.meta
/Assets/Graph/Models/Vegetation/Ground/Textures/GroundVegetation_BC.tga.meta
/Assets/Graph/Models/Vegetation/Ground/Textures/GroundVegetation_H.tga.meta
/Assets/Graph/Models/Vegetation/Ground/Textures/GroundVegetation_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Ground/Textures/GroundVegetation_N.tga.meta
/Assets/Graph/Models/Vegetation/Ivy/Textures/IvyRoot_BC.tga.meta
/Assets/Graph/Models/Vegetation/Ivy/Textures/IvyRoot_N.tga.meta
/Assets/Graph/Models/Vegetation/Ivy/Textures/IvyTree_BC.tga.meta
/Assets/Graph/Models/Vegetation/Ivy/Textures/IvyTree_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Ivy/Textures/IvyTree_N.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_BC.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_Cone_BC.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_Cone_H.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_Cone_LOD_BC.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_Cone_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_Cone_N.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_MSK.tga.meta
/Assets/Graph/Models/Vegetation/Pine/Textures/Pine_N.tga.meta
/Assets/Graph/Utilities/Textures/Neutral_MSK.tga.meta
/Assets/Graph/Utilities/Textures/VolumeTest_01_H.tga.meta
/Assets/Graph/Utilities/Textures/VolumeTest_01_N.tga.meta
/Assets/Graph/Utilities/Textures/round_normals_n.tga.meta
/Assets/Graph/Utilities/Models/DebugNormHeight/DebugNormHeight_H.exr.meta
/Assets/Graph/Utilities/Models/DebugNormHeight/DebugNormHeight_MSK.tga.meta
/Assets/Graph/Utilities/Models/DebugNormHeight/DebugNormHeight_N.tga.meta
/Assets/Scenes/Demo/Demo.unity
/Assets/Scenes/Demo/Demo_GR.unity
/Assets/Scenes/Demo/Demo_LI_Day.unity
/Assets/Scenes/Demo/Demo_LI_Sunset.unity
/Assets/Scenes/Demo/Demo_LI_Sunset_Profiles/SunsetSkyFogSettings.asset
/Assets/Scenes/Demo/Settings/PostProcessing/NightPost.asset
/Assets/Scenes/Demo/Demo_LI_Sunset/LightingData.asset
/Assets/VisualEffects/Textures/FallingLeaves_4x4_BC.tga.meta
/Assets/VisualEffects/Textures/FallingLeaves_4x4_MSK.tga.meta
/Assets/VisualEffects/Textures/FallingLeaves_4x4_N.tga.meta
/UserSettings
/Assets/Graph/Utilities/Models/GroundPlanes/Materials.meta
/Assets/Graph/Utilities/Models/GroundPlanes/Materials
/Assets/Graph/Utilities/Models/Materials/Default.mat
/Assets/Graph/Utilities/Models/Materials/Default.mat.meta
/Assets/Graph/Utilities/Models/DebugNormHeight/Materials.meta
/Assets/Graph/Utilities/Models/DebugNormHeight/Materials
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
/Assets/Graph/ThirdPersonCharacter
7 次代码提交
main
...
feature-ME-dolly
作者 | SHA1 | 备注 | 提交日期 |
---|---|---|---|
GitHub | 04005997 | Merge branch 'master-ME' into feature-ME/dolly | 5 年前 |
etienne cella | 67d0993d | fix light switch | 5 年前 |
etienne cella | 8623253b | make buffer invalidation optional | 5 年前 |
etienne cella | 146d8e35 | show cursor in editor, hide it in player | 5 年前 |
etienne cella | bc52b643 | update manifest, add camera control modes: dolly, free, cubemap | 5 年前 |
etienne cella | b7acbd59 | clustersync rename, lower TAA sharpening to reduce blur effect on leafs | 5 年前 |
Adam-Myhill | a4bceb31 |
Camera / Post: Slowed down camera, tuned post
Less CA, slight value tweaks, overall a bit smoother now |
5 年前 |
共有 394 个文件被更改,包括 842 次插入 和 530 次删除
-
45Assets/Animation/Cinematic.playable
-
80Assets/HDRPDefaultResources/DefaultRenderingSettings.asset
-
86Assets/Prefabs/Gameplay/FirstPersonCharacter.prefab
-
65Assets/Resources/VirtualCameraManager.prefab
-
496Assets/Scripts/LensFlare/HDRPLensFlare.cs
-
2Assets/Scripts/LensFlare/Shader/LensFlareHDRPAdditive.shader
-
301Assets/Scripts/LensFlare/Shader/LensFlareHDRPCommon.hlsl
-
2Assets/Scripts/LensFlare/Shader/LensFlareHDRPLerp.shader
-
4Assets/Scripts/LensFlare/Shader/LensFlareHDRPPremultiplied.shader
-
111Assets/Scripts/BasicWind/Shadergraphs/SubGraphs/BasicWind_ShiverWind.shadersubgraph
-
2Assets/Graph/GenericMaterials/Generic/Textures/Neutral_H.tga.meta
-
2Assets/Graph/GenericMaterials/Generic/Textures/Neutral_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Generic/Textures/Neutral_N.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_H.exr.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_H.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Ground_01_4x4_N.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_H.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Moss_01_N.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_H.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_01_2x2_N.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_H.exr.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Grounds/Textures/Sand_02_2x2_01_N.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_H.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/MossDetail_01_N.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/Sprig_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/Sprig_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Moss/Textures/Sprig_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_H.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_01_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_H.exr.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_02_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_H.exr.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_03_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_H.exr.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_MSK.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/StoneMat_04_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_01_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_02_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_03_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_04_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_05_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_06_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_A.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rock_lichen_07_u_N.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_BC.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_H.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_M.tga.meta
-
2Assets/Graph/GenericMaterials/Rocks/Textures/rockmoss01_tiled_u_N.tga.meta
-
2Assets/Graph/Lighting/Decals/Textures/DC_puddle01_BC.tga.meta
-
2Assets/Graph/Lighting/Decals/Textures/DC_puddle01_M.tga.meta
-
2Assets/Graph/Lighting/Decals/Textures/DC_puddle01_N.tga.meta
-
2Assets/Graph/Lighting/Textures/CloudNoise_A.tga.meta
-
2Assets/Graph/Lighting/Textures/lantern_A.tga.meta
-
2Assets/Graph/Lighting/Textures/lantern_H.tga.meta
-
2Assets/Graph/Lighting/Textures/lantern_N.tga.meta
-
2Assets/Graph/Lighting/Textures/noise_A.tga.meta
-
2Assets/Graph/Models/Grounds/Textures/Background_BC.tga.meta
-
2Assets/Graph/Models/Grounds/Textures/Background_N.tga.meta
-
2Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_BC.tga.meta
-
2Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_H.tga.meta
-
2Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_MSK.tga.meta
-
2Assets/Graph/Models/Props/BigRoot/Textures/BigRoot_N.tga.meta
-
2Assets/Graph/Models/Props/BigRoot/Textures/Roots_Layers.tga.meta
-
2Assets/Graph/Models/Props/Dragon/Textures/Dragon_BC.png.meta
-
2Assets/Graph/Models/Props/Dragon/Textures/Dragon_MSK.tga.meta
-
2Assets/Graph/Models/Props/Dragon/Textures/Dragon_N.tga.meta
-
2Assets/Graph/Models/Props/Ground/Textures/Deco_011_BC.tga.meta
-
2Assets/Graph/Models/Props/Ground/Textures/Deco_011_H.tga.meta
-
2Assets/Graph/Models/Props/Ground/Textures/Deco_011_Layers.tga.meta
-
2Assets/Graph/Models/Props/Ground/Textures/Deco_011_MSK.tga.meta
|
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace HDRPSamples |
|||
{ |
|||
[ExecuteInEditMode] |
|||
[RequireComponent(typeof(MeshRenderer))] |
|||
[RequireComponent(typeof(MeshFilter))] |
|||
public class HDRPLensFlare : MonoBehaviour |
|||
{ |
|||
[SerializeField, HideInInspector] |
|||
MeshRenderer m_MeshRenderer; |
|||
[SerializeField, HideInInspector] |
|||
MeshFilter m_MeshFilter; |
|||
[SerializeField] |
|||
Light m_Light; |
|||
|
|||
[Header("Global Settings")] |
|||
public float OcclusionRadius = 1.0f; |
|||
public float NearFadeStartDistance = 1.0f; |
|||
public float NearFadeEndDistance = 3.0f; |
|||
public float FarFadeStartDistance = 10.0f; |
|||
public float FarFadeEndDistance = 50.0f; |
|||
|
|||
[Header("Flare Element Settings")] |
|||
[SerializeField] |
|||
public List<FlareSettings> Flares; |
|||
|
|||
void Awake() |
|||
{ |
|||
if (m_MeshFilter == null) |
|||
m_MeshFilter = GetComponent<MeshFilter>(); |
|||
if (m_MeshRenderer == null) |
|||
m_MeshRenderer = GetComponent<MeshRenderer>(); |
|||
|
|||
m_Light = GetComponent<Light>(); |
|||
|
|||
m_MeshFilter.hideFlags = HideFlags.None; |
|||
m_MeshRenderer.hideFlags = HideFlags.None; |
|||
|
|||
if (Flares == null) |
|||
Flares = new List<FlareSettings>(); |
|||
|
|||
m_MeshFilter.mesh = InitMesh(); |
|||
} |
|||
|
|||
void OnEnable() |
|||
{ |
|||
UpdateGeometry(); |
|||
} |
|||
|
|||
|
|||
// Use this for initialization
|
|||
void Start () |
|||
{ |
|||
m_Light = GetComponent<Light>(); |
|||
} |
|||
|
|||
void OnValidate() |
|||
{ |
|||
UpdateGeometry(); |
|||
UpdateMaterials(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update () |
|||
{ |
|||
// Lazy!
|
|||
UpdateVaryingAttributes(); |
|||
} |
|||
|
|||
Mesh InitMesh() |
|||
{ |
|||
Mesh m = new Mesh(); |
|||
m.MarkDynamic(); |
|||
return m; |
|||
} |
|||
|
|||
void UpdateMaterials() |
|||
{ |
|||
Material[] mats = new Material[Flares.Count]; |
|||
|
|||
int i = 0; |
|||
foreach(FlareSettings f in Flares) |
|||
{ |
|||
mats[i] = f.Material; |
|||
i++; |
|||
} |
|||
m_MeshRenderer.sharedMaterials = mats; |
|||
} |
|||
|
|||
void UpdateGeometry() |
|||
{ |
|||
Mesh m = m_MeshFilter.sharedMesh; |
|||
|
|||
// Positions
|
|||
List<Vector3> vertices = new List<Vector3>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
vertices.Add(new Vector3(-1, -1, 0)); |
|||
vertices.Add(new Vector3(1, -1, 0)); |
|||
vertices.Add(new Vector3(1, 1, 0)); |
|||
vertices.Add(new Vector3(-1, 1, 0)); |
|||
} |
|||
m.SetVertices(vertices); |
|||
|
|||
// UVs
|
|||
List<Vector2> uvs = new List<Vector2>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
uvs.Add(new Vector2(0, 1)); |
|||
uvs.Add(new Vector2(1, 1)); |
|||
uvs.Add(new Vector2(1, 0)); |
|||
uvs.Add(new Vector2(0, 0)); |
|||
} |
|||
m.SetUVs(0, uvs); |
|||
|
|||
// Variable Data
|
|||
m.SetColors(GetLensFlareColor()); |
|||
m.SetUVs(1, GetLensFlareData()); |
|||
m.SetUVs(2, GetWorldPositionAndRadius()); |
|||
m.SetUVs(3, GetDistanceFadeData()); |
|||
|
|||
m.subMeshCount = Flares.Count; |
|||
|
|||
// Tris
|
|||
for (int i = 0; i < Flares.Count; i++) |
|||
{ |
|||
int[] tris = new int[6]; |
|||
tris[0] = (i * 4) + 0; |
|||
tris[1] = (i * 4) + 1; |
|||
tris[2] = (i * 4) + 2; |
|||
tris[3] = (i * 4) + 2; |
|||
tris[4] = (i * 4) + 3; |
|||
tris[5] = (i * 4) + 0; |
|||
m.SetTriangles(tris, i); |
|||
} |
|||
|
|||
Bounds b = m.bounds; |
|||
b.extents = new Vector3(OcclusionRadius, OcclusionRadius, OcclusionRadius); |
|||
m.bounds = b; |
|||
m.UploadMeshData(false); |
|||
} |
|||
|
|||
void UpdateVaryingAttributes() |
|||
{ |
|||
Mesh m = m_MeshFilter.sharedMesh; |
|||
|
|||
m.SetColors(GetLensFlareColor()); |
|||
m.SetUVs(1, GetLensFlareData()); |
|||
m.SetUVs(2, GetWorldPositionAndRadius()); |
|||
m.SetUVs(3, GetDistanceFadeData()); |
|||
|
|||
Bounds b = m.bounds; |
|||
b.extents = new Vector3(OcclusionRadius, OcclusionRadius, OcclusionRadius); |
|||
m.bounds = b; |
|||
m.name = "LensFlare (" + gameObject.name + ")"; |
|||
} |
|||
|
|||
List<Color> GetLensFlareColor() |
|||
{ |
|||
List<Color> colors = new List<Color>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
Color c = (s.MultiplyByLightColor && m_Light != null)? s.Color * m_Light.color * m_Light.intensity : s.Color; |
|||
|
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
} |
|||
return colors; |
|||
} |
|||
|
|||
List<Vector4> GetLensFlareData() |
|||
{ |
|||
List<Vector4> lfData = new List<Vector4>(); |
|||
|
|||
foreach(FlareSettings s in Flares) |
|||
{ |
|||
Vector4 data = new Vector4(s.RayPosition, s.AutoRotate? -1 : Mathf.Abs(s.Rotation), s.Size.x, s.Size.y); |
|||
lfData.Add(data); lfData.Add(data); lfData.Add(data); lfData.Add(data); |
|||
} |
|||
return lfData; |
|||
} |
|||
List<Vector4> GetDistanceFadeData() |
|||
{ |
|||
List<Vector4> fadeData = new List<Vector4>(); |
|||
|
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
Vector4 data = new Vector4(NearFadeStartDistance,NearFadeEndDistance, FarFadeStartDistance, FarFadeEndDistance); |
|||
fadeData.Add(data); fadeData.Add(data); fadeData.Add(data); fadeData.Add(data); |
|||
} |
|||
return fadeData; |
|||
} |
|||
|
|||
|
|||
List<Vector4> GetWorldPositionAndRadius() |
|||
{ |
|||
List<Vector4> worldPos = new List<Vector4>(); |
|||
Vector3 pos = transform.position; |
|||
Vector4 value = new Vector4(pos.x,pos.y,pos.z, OcclusionRadius); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
worldPos.Add(value); worldPos.Add(value); worldPos.Add(value); worldPos.Add(value); |
|||
} |
|||
|
|||
return worldPos; |
|||
} |
|||
|
|||
void OnDrawGizmosSelected() |
|||
{ |
|||
Gizmos.color = new Color(1, 0, 0, 0.3f); |
|||
Gizmos.DrawSphere(transform.position, OcclusionRadius); |
|||
Gizmos.color = Color.red; |
|||
Gizmos.DrawWireSphere(transform.position, OcclusionRadius); |
|||
} |
|||
|
|||
[System.Serializable] |
|||
public class FlareSettings |
|||
{ |
|||
public float RayPosition; |
|||
public Material Material; |
|||
[ColorUsage(true,true)] |
|||
public Color Color; |
|||
public bool MultiplyByLightColor; |
|||
public Vector2 Size; |
|||
public float Rotation; |
|||
public bool AutoRotate; |
|||
|
|||
public FlareSettings() |
|||
{ |
|||
RayPosition = 0.0f; |
|||
Color = Color.white; |
|||
MultiplyByLightColor = true; |
|||
Size = new Vector2(0.3f, 0.3f); |
|||
Rotation = 0.0f; |
|||
AutoRotate = false; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
namespace HDRPSamples |
|||
{ |
|||
[ExecuteInEditMode] |
|||
[RequireComponent(typeof(MeshRenderer))] |
|||
[RequireComponent(typeof(MeshFilter))] |
|||
[RequireComponent(typeof(CustomDepthBuffer))] |
|||
public class HDRPLensFlare : MonoBehaviour |
|||
{ |
|||
[SerializeField, HideInInspector] |
|||
MeshRenderer m_MeshRenderer; |
|||
[SerializeField, HideInInspector] |
|||
MeshFilter m_MeshFilter; |
|||
[SerializeField] |
|||
Light m_Light; |
|||
|
|||
CustomDepthBuffer m_CustomDepthBuffer; |
|||
|
|||
[Header("Global Settings")] |
|||
public float OcclusionRadius = 1.0f; |
|||
public float NearFadeStartDistance = 1.0f; |
|||
public float NearFadeEndDistance = 3.0f; |
|||
public float FarFadeStartDistance = 10.0f; |
|||
public float FarFadeEndDistance = 50.0f; |
|||
|
|||
[Header("Flare Element Settings")] |
|||
[SerializeField] |
|||
public List<FlareSettings> Flares; |
|||
|
|||
void Awake() |
|||
{ |
|||
if (m_MeshFilter == null) |
|||
m_MeshFilter = GetComponent<MeshFilter>(); |
|||
if (m_MeshRenderer == null) |
|||
m_MeshRenderer = GetComponent<MeshRenderer>(); |
|||
if (m_CustomDepthBuffer == null) |
|||
m_CustomDepthBuffer = GetComponent<CustomDepthBuffer>(); |
|||
|
|||
m_Light = GetComponent<Light>(); |
|||
|
|||
m_MeshFilter.hideFlags = HideFlags.None; |
|||
m_MeshRenderer.hideFlags = HideFlags.None; |
|||
|
|||
if (Flares == null) |
|||
Flares = new List<FlareSettings>(); |
|||
|
|||
m_MeshFilter.mesh = InitMesh(); |
|||
} |
|||
|
|||
void OnEnable() |
|||
{ |
|||
UpdateGeometry(); |
|||
} |
|||
|
|||
void OnValidate() |
|||
{ |
|||
UpdateGeometry(); |
|||
UpdateMaterials(); |
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update () |
|||
{ |
|||
// Lazy!
|
|||
UpdateVaryingAttributes(); |
|||
|
|||
// TODO optimize!
|
|||
var depthBuffer = m_CustomDepthBuffer.target; |
|||
var depthBufferZParams = m_CustomDepthBuffer.zBufferParams; |
|||
if (depthBuffer != null) |
|||
{ |
|||
foreach (var mat in m_MeshRenderer.materials) |
|||
{ |
|||
mat.SetTexture("_CustomDepthTex", depthBuffer); |
|||
mat.SetVector("_CustomDepthZBufferParams", depthBufferZParams); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Mesh InitMesh() |
|||
{ |
|||
Mesh m = new Mesh(); |
|||
m.MarkDynamic(); |
|||
return m; |
|||
} |
|||
|
|||
void UpdateMaterials() |
|||
{ |
|||
Material[] mats = new Material[Flares.Count]; |
|||
|
|||
int i = 0; |
|||
foreach(FlareSettings f in Flares) |
|||
{ |
|||
mats[i] = f.Material; |
|||
i++; |
|||
} |
|||
m_MeshRenderer.sharedMaterials = mats; |
|||
} |
|||
|
|||
void UpdateGeometry() |
|||
{ |
|||
Mesh m = m_MeshFilter.sharedMesh; |
|||
|
|||
// Positions
|
|||
List<Vector3> vertices = new List<Vector3>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
vertices.Add(new Vector3(-1, -1, 0)); |
|||
vertices.Add(new Vector3(1, -1, 0)); |
|||
vertices.Add(new Vector3(1, 1, 0)); |
|||
vertices.Add(new Vector3(-1, 1, 0)); |
|||
} |
|||
m.SetVertices(vertices); |
|||
|
|||
// UVs
|
|||
List<Vector2> uvs = new List<Vector2>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
uvs.Add(new Vector2(0, 1)); |
|||
uvs.Add(new Vector2(1, 1)); |
|||
uvs.Add(new Vector2(1, 0)); |
|||
uvs.Add(new Vector2(0, 0)); |
|||
} |
|||
m.SetUVs(0, uvs); |
|||
|
|||
// Variable Data
|
|||
m.SetColors(GetLensFlareColor()); |
|||
m.SetUVs(1, GetLensFlareData()); |
|||
m.SetUVs(2, GetWorldPositionAndRadius()); |
|||
m.SetUVs(3, GetDistanceFadeData()); |
|||
|
|||
m.subMeshCount = Flares.Count; |
|||
|
|||
// Tris
|
|||
for (int i = 0; i < Flares.Count; i++) |
|||
{ |
|||
int[] tris = new int[6]; |
|||
tris[0] = (i * 4) + 0; |
|||
tris[1] = (i * 4) + 1; |
|||
tris[2] = (i * 4) + 2; |
|||
tris[3] = (i * 4) + 2; |
|||
tris[4] = (i * 4) + 3; |
|||
tris[5] = (i * 4) + 0; |
|||
m.SetTriangles(tris, i); |
|||
} |
|||
|
|||
Bounds b = m.bounds; |
|||
b.extents = new Vector3(OcclusionRadius, OcclusionRadius, OcclusionRadius); |
|||
m.bounds = b; |
|||
m.UploadMeshData(false); |
|||
} |
|||
|
|||
void UpdateVaryingAttributes() |
|||
{ |
|||
Mesh m = m_MeshFilter.sharedMesh; |
|||
|
|||
m.SetColors(GetLensFlareColor()); |
|||
m.SetUVs(1, GetLensFlareData()); |
|||
m.SetUVs(2, GetWorldPositionAndRadius()); |
|||
m.SetUVs(3, GetDistanceFadeData()); |
|||
|
|||
Bounds b = m.bounds; |
|||
b.extents = new Vector3(OcclusionRadius, OcclusionRadius, OcclusionRadius); |
|||
m.bounds = b; |
|||
m.name = "LensFlare (" + gameObject.name + ")"; |
|||
} |
|||
|
|||
List<Color> GetLensFlareColor() |
|||
{ |
|||
List<Color> colors = new List<Color>(); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
Color c = (s.MultiplyByLightColor && m_Light != null)? s.Color * m_Light.color * m_Light.intensity : s.Color; |
|||
|
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
colors.Add(c); |
|||
} |
|||
return colors; |
|||
} |
|||
|
|||
List<Vector4> GetLensFlareData() |
|||
{ |
|||
List<Vector4> lfData = new List<Vector4>(); |
|||
|
|||
foreach(FlareSettings s in Flares) |
|||
{ |
|||
Vector4 data = new Vector4(s.RayPosition, s.AutoRotate? -1 : Mathf.Abs(s.Rotation), s.Size.x, s.Size.y); |
|||
lfData.Add(data); lfData.Add(data); lfData.Add(data); lfData.Add(data); |
|||
} |
|||
return lfData; |
|||
} |
|||
List<Vector4> GetDistanceFadeData() |
|||
{ |
|||
List<Vector4> fadeData = new List<Vector4>(); |
|||
|
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
Vector4 data = new Vector4(NearFadeStartDistance,NearFadeEndDistance, FarFadeStartDistance, FarFadeEndDistance); |
|||
fadeData.Add(data); fadeData.Add(data); fadeData.Add(data); fadeData.Add(data); |
|||
} |
|||
return fadeData; |
|||
} |
|||
|
|||
|
|||
List<Vector4> GetWorldPositionAndRadius() |
|||
{ |
|||
List<Vector4> worldPos = new List<Vector4>(); |
|||
Vector3 pos = transform.position; |
|||
Vector4 value = new Vector4(pos.x,pos.y,pos.z, OcclusionRadius); |
|||
foreach (FlareSettings s in Flares) |
|||
{ |
|||
worldPos.Add(value); worldPos.Add(value); worldPos.Add(value); worldPos.Add(value); |
|||
} |
|||
|
|||
return worldPos; |
|||
} |
|||
|
|||
void OnDrawGizmosSelected() |
|||
{ |
|||
Gizmos.color = new Color(1, 0, 0, 0.3f); |
|||
Gizmos.DrawSphere(transform.position, OcclusionRadius); |
|||
Gizmos.color = Color.red; |
|||
Gizmos.DrawWireSphere(transform.position, OcclusionRadius); |
|||
} |
|||
|
|||
[System.Serializable] |
|||
public class FlareSettings |
|||
{ |
|||
public float RayPosition; |
|||
public Material Material; |
|||
[ColorUsage(true,true)] |
|||
public Color Color; |
|||
public bool MultiplyByLightColor; |
|||
public Vector2 Size; |
|||
public float Rotation; |
|||
public bool AutoRotate; |
|||
|
|||
public FlareSettings() |
|||
{ |
|||
RayPosition = 0.0f; |
|||
Color = Color.white; |
|||
MultiplyByLightColor = true; |
|||
Size = new Vector2(0.3f, 0.3f); |
|||
Rotation = 0.0f; |
|||
AutoRotate = false; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
struct appdata |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float2 uv : TEXCOORD0; |
|||
float4 color : COLOR; |
|||
|
|||
// LensFlare Data : |
|||
// * X = RayPos |
|||
// * Y = Rotation (< 0 = Auto) |
|||
// * ZW = Size (Width, Height) in Screen Height Ratio |
|||
nointerpolation float4 lensflare_data : TEXCOORD1; |
|||
// World Position (XYZ) and Radius(W) : |
|||
nointerpolation float4 worldPosRadius : TEXCOORD2; |
|||
// LensFlare FadeData : |
|||
// * X = Near Start Distance |
|||
// * Y = Near End Distance |
|||
// * Z = Far Start Distance |
|||
// * W = Far End Distance |
|||
nointerpolation float4 lensflare_fadeData : TEXCOORD3; |
|||
}; |
|||
|
|||
struct v2f |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
float4 vertex : SV_POSITION; |
|||
float4 color : COLOR; |
|||
}; |
|||
|
|||
sampler2D _MainTex; |
|||
float _OccludedSizeScale; |
|||
|
|||
// thanks, internets |
|||
static const uint DEPTH_SAMPLE_COUNT = 32; |
|||
static float2 samples[DEPTH_SAMPLE_COUNT] = { |
|||
float2(0.658752441406,-0.0977704077959), |
|||
float2(0.505380451679,-0.862896621227), |
|||
float2(-0.678673446178,0.120453640819), |
|||
float2(-0.429447203875,-0.501827657223), |
|||
float2(-0.239791020751,0.577527523041), |
|||
float2(-0.666824519634,-0.745214760303), |
|||
float2(0.147858589888,-0.304675519466), |
|||
float2(0.0334240831435,0.263438135386), |
|||
float2(-0.164710089564,-0.17076793313), |
|||
float2(0.289210408926,0.0226817727089), |
|||
float2(0.109557107091,-0.993980526924), |
|||
float2(-0.999996423721,-0.00266989553347), |
|||
float2(0.804284930229,0.594243884087), |
|||
float2(0.240315377712,-0.653567194939), |
|||
float2(-0.313934922218,0.94944447279), |
|||
float2(0.386928111315,0.480902403593), |
|||
float2(0.979771316051,-0.200120285153), |
|||
float2(0.505873680115,-0.407543361187), |
|||
float2(0.617167234421,0.247610524297), |
|||
float2(-0.672138273716,0.740425646305), |
|||
float2(-0.305256098509,-0.952270269394), |
|||
float2(0.493631094694,0.869671344757), |
|||
float2(0.0982239097357,0.995164275169), |
|||
float2(0.976404249668,0.21595069766), |
|||
float2(-0.308868765831,0.150203511119), |
|||
float2(-0.586166858673,-0.19671548903), |
|||
float2(-0.912466347218,-0.409151613712), |
|||
float2(0.0959918648005,0.666364192963), |
|||
float2(0.813257217407,-0.581904232502), |
|||
float2(-0.914829492569,0.403840065002), |
|||
float2(-0.542099535465,0.432246923447), |
|||
float2(-0.106764614582,-0.618209302425) |
|||
}; |
|||
|
|||
float GetOcclusion(float2 screenPos, float depth, float radius, float ratio) |
|||
{ |
|||
float contrib = 0.0f; |
|||
float sample_Contrib = 1.0 / DEPTH_SAMPLE_COUNT; |
|||
float2 ratioScale = float2(1 / ratio, 1.0); |
|||
for (uint i = 0; i < DEPTH_SAMPLE_COUNT; i++) |
|||
{ |
|||
float2 pos = screenPos + (samples[i] * radius * ratioScale); |
|||
pos = pos * 0.5 + 0.5; |
|||
pos.y = 1 - pos.y; |
|||
if (pos.x >= 0 && pos.x <= 1 && pos.y >= 0 && pos.y <= 1) |
|||
{ |
|||
//float sampledDepth = LinearEyeDepth(SAMPLE_TEXTURE2D_LOD(_CameraDepthTexture, sampler_CameraDepthTexture, pos, 0).r, _ZBufferParams); |
|||
float sampledDepth = LinearEyeDepth(SampleCameraDepth(pos), _ZBufferParams); |
|||
|
|||
if (sampledDepth >= depth) |
|||
contrib += sample_Contrib; |
|||
} |
|||
} |
|||
return contrib; |
|||
} |
|||
|
|||
v2f vert(appdata v) |
|||
{ |
|||
v2f o; |
|||
|
|||
float4 clip = TransformWorldToHClip(GetCameraRelativePositionWS(v.worldPosRadius.xyz)); |
|||
float depth = clip.w; |
|||
|
|||
float3 cameraUp = normalize(mul(UNITY_MATRIX_V, float4(0, 1, 0, 0))).xyz; |
|||
|
|||
float4 extent = TransformWorldToHClip(GetCameraRelativePositionWS(v.worldPosRadius.xyz + cameraUp * v.worldPosRadius.w)); |
|||
|
|||
float2 screenPos = clip.xy / clip.w; |
|||
float2 extentPos = extent.xy / extent.w; |
|||
|
|||
float radius = distance(screenPos, extentPos); |
|||
|
|||
float ratio = _ScreenParams.x / _ScreenParams.y; |
|||
float occlusion = GetOcclusion(screenPos, depth - v.worldPosRadius.w, radius, ratio); |
|||
|
|||
// Distance Fade |
|||
float4 d = v.lensflare_fadeData; |
|||
float distanceFade = saturate((depth - d.x) / (d.y - d.x)); |
|||
distanceFade *= 1.0f - saturate((depth - d.z) / (d.w - d.z)); |
|||
|
|||
// position and rotate |
|||
float angle = v.lensflare_data.y; |
|||
if (angle < 0) // Automatic |
|||
{ |
|||
float2 dir = normalize(screenPos); |
|||
angle = atan2(dir.y, dir.x) + 1.57079632675; // arbitrary, we need V to face the source, not U; |
|||
} |
|||
|
|||
// apply size |
|||
float2 quad_size = lerp(_OccludedSizeScale, 1.0f, occlusion) * v.lensflare_data.zw; |
|||
if (distanceFade * occlusion == 0.0f) // if either one or other is zeroed |
|||
quad_size = float2(0, 0); // clip |
|||
|
|||
float2 local = v.vertex.xy * quad_size; |
|||
|
|||
local = float2( |
|||
local.x * cos(angle) + local.y * (-sin(angle)), |
|||
local.x * sin(angle) + local.y * cos(angle)); |
|||
|
|||
// adjust to correct ratio |
|||
local.x /= ratio; |
|||
|
|||
float2 rayOffset = -screenPos * v.lensflare_data.x; |
|||
o.vertex.w = v.vertex.w; |
|||
o.vertex.xy = screenPos + local + rayOffset; |
|||
|
|||
o.vertex.z = 1; |
|||
o.uv = v.uv; |
|||
|
|||
o.color = v.color * occlusion * distanceFade * saturate(length(screenPos * 2)); |
|||
return o; |
|||
} |
|||
#include "Packages\com.unity.render-pipelines.high-definition\Runtime\ShaderLibrary\ClusterDisplay.hlsl" |
|||
|
|||
struct appdata |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float2 uv : TEXCOORD0; |
|||
float4 color : COLOR; |
|||
|
|||
// LensFlare Data : |
|||
// * X = RayPos |
|||
// * Y = Rotation (< 0 = Auto) |
|||
// * ZW = Size (Width, Height) in Screen Height Ratio |
|||
nointerpolation float4 lensflare_data : TEXCOORD1; |
|||
// World Position (XYZ) and Radius(W) : |
|||
nointerpolation float4 worldPosRadius : TEXCOORD2; |
|||
// LensFlare FadeData : |
|||
// * X = Near Start Distance |
|||
// * Y = Near End Distance |
|||
// * Z = Far Start Distance |
|||
// * W = Far End Distance |
|||
nointerpolation float4 lensflare_fadeData : TEXCOORD3; |
|||
}; |
|||
|
|||
struct v2f |
|||
{ |
|||
float2 uv : TEXCOORD0; |
|||
float4 vertex : SV_POSITION; |
|||
float4 color : COLOR; |
|||
}; |
|||
|
|||
sampler2D _MainTex; |
|||
sampler2D _CustomDepthTex; |
|||
float4 _CustomDepthTex_TexelSize; |
|||
float4 _CustomDepthZBufferParams; |
|||
float _OccludedSizeScale; |
|||
|
|||
// thanks, internets |
|||
static const uint DEPTH_SAMPLE_COUNT = 32; |
|||
static float2 samples[DEPTH_SAMPLE_COUNT] = { |
|||
float2(0.658752441406,-0.0977704077959), |
|||
float2(0.505380451679,-0.862896621227), |
|||
float2(-0.678673446178,0.120453640819), |
|||
float2(-0.429447203875,-0.501827657223), |
|||
float2(-0.239791020751,0.577527523041), |
|||
float2(-0.666824519634,-0.745214760303), |
|||
float2(0.147858589888,-0.304675519466), |
|||
float2(0.0334240831435,0.263438135386), |
|||
float2(-0.164710089564,-0.17076793313), |
|||
float2(0.289210408926,0.0226817727089), |
|||
float2(0.109557107091,-0.993980526924), |
|||
float2(-0.999996423721,-0.00266989553347), |
|||
float2(0.804284930229,0.594243884087), |
|||
float2(0.240315377712,-0.653567194939), |
|||
float2(-0.313934922218,0.94944447279), |
|||
float2(0.386928111315,0.480902403593), |
|||
float2(0.979771316051,-0.200120285153), |
|||
float2(0.505873680115,-0.407543361187), |
|||
float2(0.617167234421,0.247610524297), |
|||
float2(-0.672138273716,0.740425646305), |
|||
float2(-0.305256098509,-0.952270269394), |
|||
float2(0.493631094694,0.869671344757), |
|||
float2(0.0982239097357,0.995164275169), |
|||
float2(0.976404249668,0.21595069766), |
|||
float2(-0.308868765831,0.150203511119), |
|||
float2(-0.586166858673,-0.19671548903), |
|||
float2(-0.912466347218,-0.409151613712), |
|||
float2(0.0959918648005,0.666364192963), |
|||
float2(0.813257217407,-0.581904232502), |
|||
float2(-0.914829492569,0.403840065002), |
|||
float2(-0.542099535465,0.432246923447), |
|||
float2(-0.106764614582,-0.618209302425) |
|||
}; |
|||
|
|||
float GetOcclusion(float2 screenPos, float depth, float radius, float ratio) |
|||
{ |
|||
float contrib = 0.0f; |
|||
float sample_Contrib = 1.0 / DEPTH_SAMPLE_COUNT; |
|||
float2 ratioScale = float2(1 / ratio, 1.0); |
|||
for (uint i = 0; i < DEPTH_SAMPLE_COUNT; i++) |
|||
{ |
|||
float2 pos = screenPos + (samples[i] * radius * ratioScale); |
|||
pos = pos * 0.5 + 0.5; |
|||
pos.y = 1 - pos.y; |
|||
|
|||
if (pos.x >= 0 && pos.x <= 1 && pos.y >= 0 && pos.y <= 1) |
|||
{ |
|||
#if defined(USING_CLUSTER_DISPLAY) |
|||
float sampledDepth = LinearEyeDepth(tex2Dlod(_CustomDepthTex, float4(pos, 0, 0)).r, _CustomDepthZBufferParams); |
|||
#else |
|||
float sampledDepth = LinearEyeDepth(SampleCameraDepth(pos), _ZBufferParams); |
|||
#endif |
|||
if (sampledDepth >= depth) |
|||
contrib += sample_Contrib; |
|||
} |
|||
} |
|||
return contrib; |
|||
} |
|||
|
|||
v2f vert(appdata v) |
|||
{ |
|||
v2f o; |
|||
|
|||
float4 clip = TransformWorldToHClip(GetCameraRelativePositionWS(v.worldPosRadius.xyz)); |
|||
float depth = clip.w; |
|||
|
|||
float3 cameraUp = normalize(mul(UNITY_MATRIX_V, float4(0, 1, 0, 0))).xyz; |
|||
|
|||
float4 extent = TransformWorldToHClip(GetCameraRelativePositionWS(v.worldPosRadius.xyz + cameraUp * v.worldPosRadius.w)); |
|||
|
|||
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); |
|||
|
|||
float ratio = _CustomDepthTex_TexelSize.z / _CustomDepthTex_TexelSize.w; |
|||
float occlusion = GetOcclusion(screenPos, depth - v.worldPosRadius.w, radius, ratio); |
|||
|
|||
// Distance Fade |
|||
float4 d = v.lensflare_fadeData; |
|||
float distanceFade = saturate((depth - d.x) / (d.y - d.x)); |
|||
distanceFade *= 1.0f - saturate((depth - d.z) / (d.w - d.z)); |
|||
|
|||
// position and rotate |
|||
float angle = v.lensflare_data.y; |
|||
if (angle < 0) // Automatic |
|||
{ |
|||
float2 dir = normalize(screenPos); |
|||
angle = atan2(dir.y, dir.x) + 1.57079632675; // arbitrary, we need V to face the source, not U; |
|||
} |
|||
|
|||
// apply size |
|||
float2 quad_size = lerp(_OccludedSizeScale, 1.0f, occlusion) * v.lensflare_data.zw; |
|||
if (distanceFade * occlusion == 0.0f) // if either one or other is zeroed |
|||
quad_size = float2(0, 0); // clip |
|||
|
|||
float2 local = v.vertex.xy * quad_size; |
|||
|
|||
local = float2( |
|||
local.x * cos(angle) + local.y * (-sin(angle)), |
|||
local.x * sin(angle) + local.y * cos(angle)); |
|||
|
|||
// adjust to correct ratio |
|||
local.x /= ratio; |
|||
|
|||
float2 rayOffset = -screenPos * v.lensflare_data.x; |
|||
o.vertex.w = v.vertex.w; |
|||
|
|||
o.vertex.xy = CLUSTER_TO_DEVICE_NORMALIZED_COORDINATES(screenPos + local + rayOffset); |
|||
|
|||
o.vertex.z = 1; |
|||
o.uv = v.uv; |
|||
|
|||
o.color = v.color * occlusion * distanceFade * saturate(length(screenPos * 2)); |
|||
return o; |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue