From b88d8eca3e7f1798adfa10d255b4592af28d64ce Mon Sep 17 00:00:00 2001 From: Naelstrof Date: Mon, 6 Nov 2023 18:52:27 -0700 Subject: [PATCH] Keyword cleanup, shader variant adjustments. --- .gitignore | 5 + .../AssetGroups/Default.Shaders.asset | 12 - Assets/KoboldKare/Lilith/LitheKoboldEyes.mat | 3 +- Assets/KoboldKare/Materials/AgedOakWood.mat | 3 +- Assets/KoboldKare/Materials/Bomb.mat | 5 +- Assets/KoboldKare/Materials/BucketWater.mat | 5 +- .../KoboldKare/Materials/Casino/BarrelOil.mat | 7 +- .../Materials/Casino/BlackedOut.mat | 4 +- .../Materials/Casino/CasinoLongRug.mat | 3 +- .../Materials/Casino/CasinoPigIron.mat | 6 +- .../Materials/Casino/CasinoRoundRug.mat | 4 +- .../Materials/Casino/CasinoWalls.mat | 4 +- .../Materials/Casino/GlossyDarkTile.mat | 4 +- .../Materials/Casino/TexturedBrass.mat | 5 +- .../Casino/TexturedBrassLitCheat.mat | 5 +- Assets/KoboldKare/Materials/CasinoStatue.mat | 16 +- Assets/KoboldKare/Materials/Egg.mat | 13 +- Assets/KoboldKare/Materials/EquineDildo.mat | 5 +- Assets/KoboldKare/Materials/FarmFence.mat | 6 +- Assets/KoboldKare/Materials/Hay.mat | 4 +- .../KoboldKare/Materials/HayTransparent.mat | 4 +- Assets/KoboldKare/Materials/HumanoidPenis.mat | 5 +- Assets/KoboldKare/Materials/JapaneseBrick.mat | 4 +- .../KoboldKare/Materials/KandiDickFlared.mat | 15 +- Assets/KoboldKare/Materials/Kobold.mat | 14 +- Assets/KoboldKare/Materials/KoboldDick.mat | 14 +- Assets/KoboldKare/Materials/KoboldEquine.mat | 14 +- Assets/KoboldKare/Materials/KoboldEyes.mat | 4 +- .../KoboldKare/Materials/KoboldImposter.mat | 161 - .../Materials/KoboldImposter.mat.meta | 8 - Assets/KoboldKare/Materials/KoboldTapered.mat | 4 +- .../Materials/MapMaterials/Bark.mat | 8 +- .../Materials/MapMaterials/BigRock.mat | 7 +- .../Materials/MapMaterials/BushyLeaf.mat | 7 +- .../Materials/MapMaterials/CrystalHolder.mat | 7 +- .../MapMaterials/DiscoloredRocks.mat | 7 +- .../Materials/MapMaterials/KoboPillar.mat | 6 +- .../Materials/MapMaterials/Leaf (Snow).mat | 21 +- .../Materials/MapMaterials/Leaf Static.mat | 17 +- .../Materials/MapMaterials/Leaf.mat | 3 +- .../Materials/MapMaterials/LimestonyRock.mat | 4 +- .../MapMaterials/LimestonyRockNoBlend.mat | 3 +- .../MapMaterials/Nature Rock (Surf).mat | 160 - .../MapMaterials/Nature Rock (Surf).mat.meta | 8 - .../Materials/MapMaterials/Rocks.mat | 7 +- .../Materials/MapMaterials/Roof_slate.mat | 19 +- .../MapMaterials/Woodplank (Snow).mat | 6 +- .../MapMaterials/bricks_gunmetal.mat | 7 +- .../MapMaterials/bricks_gunmetal_sm.mat | 7 +- .../Materials/MapMaterials/ceramic_bouncy.mat | 4 +- .../Materials/MapMaterials/ceramic_tiles.mat | 4 +- .../MapMaterials/ceramic_tiles_lg.mat | 18 +- .../MapMaterials/concrete_polished_matte.mat | 6 +- .../concrete_polished_matte_small.mat | 6 +- .../MapMaterials/concrete_raw_soft.mat | 6 +- .../MapMaterials/concrete_raw_soft_big.mat | 6 +- .../Materials/MapMaterials/metal_vent.mat | 19 +- .../MapMaterials/parisian_sidewalk.mat | 6 +- .../Materials/MapMaterials/parquet_wood.mat | 6 +- .../MapMaterials/pebble_rich_concrete.mat | 6 +- .../MapMaterials/plaster_acoustic.mat | 6 +- .../MapMaterials/plastic_brushed.mat | 4 +- .../Materials/MapMaterials/stucco_white.mat | 7 +- .../MapMaterials/stylized_chantily_wood.mat | 19 +- .../Materials/MapMaterials/stylized_wood.mat | 7 +- .../Materials/MapMaterials/tempered_steel.mat | 6 +- .../MapMaterials/trowled_concrete.mat | 6 +- .../MapMaterials/trowled_concrete_lg.mat | 4 +- .../Materials/MapMaterials/volga_blue.mat | 17 +- .../Materials/MapMaterials/zinc_roofing.mat | 6 +- Assets/KoboldKare/Materials/Mirrors.mat | 141 - Assets/KoboldKare/Materials/Mirrors.mat.meta | 8 - .../Materials/NipplePiercingMaterials.mat | 47 +- .../KoboldKare/Materials/NipplePumpGlossy.mat | 47 +- .../Materials/Pawnshop/BigConcreteTile.mat | 9 +- .../Materials/Pawnshop/CarBattery.mat | 9 +- .../Materials/Pawnshop/CardboardBoxLarge.mat | 8 +- .../Materials/Pawnshop/CardboardClusters.mat | 9 +- .../Materials/Pawnshop/CargoContainer.mat | 5 +- .../Materials/Pawnshop/ConcreteWall.mat | 8 +- .../Materials/Pawnshop/CrystalA.mat | 6 +- .../Materials/Pawnshop/CrystalB.mat | 7 +- .../Materials/Pawnshop/GlossyLightTile.mat | 17 +- .../Materials/Pawnshop/LargeTruss.mat | 5 +- .../Pawnshop/MetalBarsSemirusted.mat | 6 +- .../Materials/Pawnshop/MetalBeams.mat | 10 +- .../Materials/Pawnshop/MetalBunkerDoor.mat | 9 +- .../Materials/Pawnshop/PipeCopper.mat | 7 +- .../Materials/Pawnshop/PipeNormal.mat | 7 +- .../Materials/Pawnshop/PipeRusted.mat | 7 +- .../Materials/Pawnshop/PipeRusted2.mat | 4 +- .../Materials/Pawnshop/RopeCrystal.mat | 7 +- .../Materials/Pawnshop/StonePedestal.mat | 7 +- .../Materials/Pawnshop/StoreMax5000.mat | 7 +- .../Materials/Pawnshop/Trashcan.mat | 7 +- .../Materials/Pawnshop/decal_noRefunds.mat | 6 +- .../PlayerHome/PlayerHomeCircleDoor.mat | 7 +- .../Materials/PlayerHome/PlayerHomeTatami.mat | 6 +- .../Materials/PlayerHome/PlayerHouse.mat | 7 +- Assets/KoboldKare/Materials/PondWater.mat | 5 +- .../Materials/RunningWaterAgain.mat | 5 +- Assets/KoboldKare/Materials/SeaWater.mat | 5 +- .../KoboldKare/Materials/SeedExtractor 1.mat | 6 +- Assets/KoboldKare/Materials/SellDumpsterA.mat | 6 +- Assets/KoboldKare/Materials/SellDumpsterB.mat | 6 +- .../KoboldKare/Materials/Signpost_Kobold.mat | 7 +- Assets/KoboldKare/Materials/Silicone.mat | 13 +- Assets/KoboldKare/Materials/StillWater.mat | 5 +- Assets/KoboldKare/Materials/TaperedDildo.mat | 4 +- Assets/KoboldKare/Materials/Tentacle.mat | 26 +- Assets/KoboldKare/Materials/WaterFall.mat | 5 +- Assets/KoboldKare/Scenes/MainMap.unity | 98 +- .../TerrainBrushVolumeTerrainMatMainMap.mat | 3 +- Assets/KoboldKare/Shaders/Bark URP.shader | 601 +-- Assets/KoboldKare/Shaders/Bouncy.shader | 806 +--- Assets/KoboldKare/Shaders/CumStream.shader | 64 +- Assets/KoboldKare/Shaders/Dick.shader | 1177 +----- Assets/KoboldKare/Shaders/Foliage.shader | 758 +--- .../KoboldKare/Shaders/FuseDissolver.shader | 1010 +---- Assets/KoboldKare/Shaders/Kobold.shader | 833 +---- Assets/KoboldKare/Shaders/KoboldBasic.shader | 64 +- Assets/KoboldKare/Shaders/Leafs URP.shader | 1120 +----- .../KoboldKare/Shaders/MappedDecalable.shader | 279 +- Assets/KoboldKare/Shaders/MirrorShader.shader | 3045 --------------- .../Shaders/MirrorShader.shader.meta | 10 - .../Shaders/NipplePiercingShader.shader | 3084 ---------------- .../Shaders/NipplePiercingShader.shader.meta | 10 - Assets/KoboldKare/Shaders/Rock.shader | 321 +- Assets/KoboldKare/Shaders/RunningWater.shader | 1444 +------- Assets/KoboldKare/Shaders/StatueShader.shader | 3019 --------------- .../Shaders/StatueShader.shader.meta | 10 - .../Shaders/TerrainBrushedDecalable.shader | 341 +- .../Shaders/Vertex Color Shader URP.shader | 3249 ----------------- .../Vertex Color Shader URP.shader.meta | 9 - Assets/KoboldKare/Shaders/WaterSample.shader | 1082 +----- .../KoboldKare/SurfMap/parquet_wood_big.mat | 6 +- .../KoboldKare/Waterfall/WaterStream.shader | 64 +- .../Vilar/VilarEyes/ExampleEyeLeft.mat | 20 +- .../Vilar/VilarEyes/ExampleEyeRight.mat | 21 +- .../Plugins/Vilar/VilarEyes/VilarEyeV2.shader | 1347 +------ .../Resources_moved/Shaders/TMP_SDF.shader | 8 +- ProjectSettings/ProjectSettings.asset | 1 - 142 files changed, 1342 insertions(+), 23924 deletions(-) delete mode 100644 Assets/KoboldKare/Materials/KoboldImposter.mat delete mode 100644 Assets/KoboldKare/Materials/KoboldImposter.mat.meta delete mode 100644 Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat delete mode 100644 Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat.meta delete mode 100644 Assets/KoboldKare/Materials/Mirrors.mat delete mode 100644 Assets/KoboldKare/Materials/Mirrors.mat.meta delete mode 100644 Assets/KoboldKare/Shaders/MirrorShader.shader delete mode 100644 Assets/KoboldKare/Shaders/MirrorShader.shader.meta delete mode 100644 Assets/KoboldKare/Shaders/NipplePiercingShader.shader delete mode 100644 Assets/KoboldKare/Shaders/NipplePiercingShader.shader.meta delete mode 100644 Assets/KoboldKare/Shaders/StatueShader.shader delete mode 100644 Assets/KoboldKare/Shaders/StatueShader.shader.meta delete mode 100644 Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader delete mode 100644 Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader.meta diff --git a/.gitignore b/.gitignore index 2fd7e9844..f10d86c64 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ [Aa]ssets/UMotionEditor.meta UMotionData/ +[Aa]ssets/ShaderControl/ +[Aa]ssets/ShaderControl.meta + # Also don't push secrets from my google sheets. [Aa]ssets/KoboldKare/Locales/Google Sheets Service.asset [Aa]ssets/KoboldKare/Locales/Google Sheets Service.asset.meta @@ -54,6 +57,8 @@ Logs/shadercompiler-AssetImportWorker0.log #*Lightmap-*.exr.meta *.blend1 *.blend1.meta +*.shader_backup +*.shader_backup.meta #*ReflectionProbe*.exr #*ReflectionProbe*.exr.meta #*OcclusionCullingData.asset \ No newline at end of file diff --git a/Assets/AddressableAssetsData/AssetGroups/Default.Shaders.asset b/Assets/AddressableAssetsData/AssetGroups/Default.Shaders.asset index 6786159c7..ebf6004a5 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Default.Shaders.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Default.Shaders.asset @@ -41,12 +41,6 @@ MonoBehaviour: m_SerializedLabels: - default FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: def7000896e247349bf958c5d2a9a6f2 - m_Address: Assets/KoboldKare/Shaders/StatueShader.shader - m_ReadOnly: 0 - m_SerializedLabels: - - default - FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 1415f2a892abc2149addb08105206ad7 m_Address: Assets/KoboldKare/Shaders/PachinkoShader.shader m_ReadOnly: 0 @@ -71,12 +65,6 @@ MonoBehaviour: m_SerializedLabels: - default FlaggedDuringContentUpdateRestriction: 0 - - m_GUID: 99d74aa18adfe114b8db023429c25ed2 - m_Address: Assets/KoboldKare/Shaders/NipplePiercingShader.shader - m_ReadOnly: 0 - m_SerializedLabels: - - default - FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 42e0f16c77d25144ea2348ca1a254645 m_Address: Assets/KoboldKare/Shaders/Leafs URP.shader m_ReadOnly: 0 diff --git a/Assets/KoboldKare/Lilith/LitheKoboldEyes.mat b/Assets/KoboldKare/Lilith/LitheKoboldEyes.mat index c9a368286..ba2b939d1 100644 --- a/Assets/KoboldKare/Lilith/LitheKoboldEyes.mat +++ b/Assets/KoboldKare/Lilith/LitheKoboldEyes.mat @@ -10,8 +10,7 @@ Material: m_Name: LitheKoboldEyes m_Shader: {fileID: 4800000, guid: 5e1d12dd9f331b94da153b99f92b9e11, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _PENETRATION_DEFORMATION_DETAIL_ON + m_InvalidKeywords: [] m_LightmapFlags: 0 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/AgedOakWood.mat b/Assets/KoboldKare/Materials/AgedOakWood.mat index 9571bca21..0c2ae5391 100644 --- a/Assets/KoboldKare/Materials/AgedOakWood.mat +++ b/Assets/KoboldKare/Materials/AgedOakWood.mat @@ -10,8 +10,7 @@ Material: m_Name: AgedOakWood m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Bomb.mat b/Assets/KoboldKare/Materials/Bomb.mat index d8ad43ad8..12f096f8d 100644 --- a/Assets/KoboldKare/Materials/Bomb.mat +++ b/Assets/KoboldKare/Materials/Bomb.mat @@ -10,10 +10,7 @@ Material: m_Name: Bomb m_Shader: {fileID: 4800000, guid: c74e1808ddaac6745ac169265a87048e, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/BucketWater.mat b/Assets/KoboldKare/Materials/BucketWater.mat index e75d250e2..eff24cdfd 100644 --- a/Assets/KoboldKare/Materials/BucketWater.mat +++ b/Assets/KoboldKare/Materials/BucketWater.mat @@ -10,10 +10,7 @@ Material: m_Name: BucketWater m_Shader: {fileID: 4800000, guid: a9cde6543f2604b4cbd3023847cb9c0b, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/BarrelOil.mat b/Assets/KoboldKare/Materials/Casino/BarrelOil.mat index 1e43312e5..94a057ea1 100644 --- a/Assets/KoboldKare/Materials/Casino/BarrelOil.mat +++ b/Assets/KoboldKare/Materials/Casino/BarrelOil.mat @@ -22,11 +22,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: BarrelOil m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/BlackedOut.mat b/Assets/KoboldKare/Materials/Casino/BlackedOut.mat index d0bee521e..bddc7505f 100644 --- a/Assets/KoboldKare/Materials/Casino/BlackedOut.mat +++ b/Assets/KoboldKare/Materials/Casino/BlackedOut.mat @@ -9,9 +9,7 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: BlackedOut m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - - _SPECULARHIGHLIGHTS_OFF + m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/Assets/KoboldKare/Materials/Casino/CasinoLongRug.mat b/Assets/KoboldKare/Materials/Casino/CasinoLongRug.mat index 0348b0c15..7f11f09d7 100644 --- a/Assets/KoboldKare/Materials/Casino/CasinoLongRug.mat +++ b/Assets/KoboldKare/Materials/Casino/CasinoLongRug.mat @@ -9,8 +9,7 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: CasinoLongRug m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF + m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/Assets/KoboldKare/Materials/Casino/CasinoPigIron.mat b/Assets/KoboldKare/Materials/Casino/CasinoPigIron.mat index 1a9bd2b23..41c1c4682 100644 --- a/Assets/KoboldKare/Materials/Casino/CasinoPigIron.mat +++ b/Assets/KoboldKare/Materials/Casino/CasinoPigIron.mat @@ -22,11 +22,7 @@ Material: m_Name: CasinoPigIron m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/CasinoRoundRug.mat b/Assets/KoboldKare/Materials/Casino/CasinoRoundRug.mat index 47b8ef175..b686d0403 100644 --- a/Assets/KoboldKare/Materials/Casino/CasinoRoundRug.mat +++ b/Assets/KoboldKare/Materials/Casino/CasinoRoundRug.mat @@ -10,9 +10,7 @@ Material: m_Name: CasinoRoundRug m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/CasinoWalls.mat b/Assets/KoboldKare/Materials/Casino/CasinoWalls.mat index f9f6d61bf..3c6465cc4 100644 --- a/Assets/KoboldKare/Materials/Casino/CasinoWalls.mat +++ b/Assets/KoboldKare/Materials/Casino/CasinoWalls.mat @@ -10,9 +10,7 @@ Material: m_Name: CasinoWalls m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/GlossyDarkTile.mat b/Assets/KoboldKare/Materials/Casino/GlossyDarkTile.mat index 4b252527f..d881b234c 100644 --- a/Assets/KoboldKare/Materials/Casino/GlossyDarkTile.mat +++ b/Assets/KoboldKare/Materials/Casino/GlossyDarkTile.mat @@ -23,9 +23,7 @@ Material: m_Name: GlossyDarkTile m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/TexturedBrass.mat b/Assets/KoboldKare/Materials/Casino/TexturedBrass.mat index 094f99f60..12599daff 100644 --- a/Assets/KoboldKare/Materials/Casino/TexturedBrass.mat +++ b/Assets/KoboldKare/Materials/Casino/TexturedBrass.mat @@ -23,10 +23,7 @@ Material: m_Name: TexturedBrass m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - ETC1_EXTERNAL_ALPHA - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Casino/TexturedBrassLitCheat.mat b/Assets/KoboldKare/Materials/Casino/TexturedBrassLitCheat.mat index fadb20776..a0820ddf1 100644 --- a/Assets/KoboldKare/Materials/Casino/TexturedBrassLitCheat.mat +++ b/Assets/KoboldKare/Materials/Casino/TexturedBrassLitCheat.mat @@ -23,10 +23,7 @@ Material: m_Name: TexturedBrassLitCheat m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - ETC1_EXTERNAL_ALPHA - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/CasinoStatue.mat b/Assets/KoboldKare/Materials/CasinoStatue.mat index bf8879433..3a69bb6e8 100644 --- a/Assets/KoboldKare/Materials/CasinoStatue.mat +++ b/Assets/KoboldKare/Materials/CasinoStatue.mat @@ -8,11 +8,9 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: CasinoStatue - m_Shader: {fileID: 4800000, guid: def7000896e247349bf958c5d2a9a6f2, type: 3} + m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -27,13 +25,17 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BaseMap: - m_Texture: {fileID: 2800000, guid: d5c584b67ceac5b4091792287ad880ce, type: 3} + m_Texture: {fileID: 2800000, guid: 239fcb087d0d9ed43b00d56d65a0fe65, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 2800000, guid: 36b991cc26140d347911bd6551a1e5ec, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _DecalColorMap: + 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} @@ -47,7 +49,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 2800000, guid: 14a404288a962d44a970f91cf82141a2, type: 3} + m_Texture: {fileID: 2800000, guid: 57078855b91c0fb44a829e52f7db3f7a, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _Normal: @@ -116,7 +118,7 @@ Material: - _ZWrite: 1 m_Colors: - _BaseColor: {r: 0.3531061, g: 0.6509434, b: 0.49749133, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.3333037, g: 0.6603774, b: 0.37870046, a: 1} - _Color0: {r: 0.2706924, g: 0.7264151, b: 0.6900828, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} diff --git a/Assets/KoboldKare/Materials/Egg.mat b/Assets/KoboldKare/Materials/Egg.mat index 6be4a4059..88904d5a9 100644 --- a/Assets/KoboldKare/Materials/Egg.mat +++ b/Assets/KoboldKare/Materials/Egg.mat @@ -10,12 +10,7 @@ Material: m_Name: Egg m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DISABLE_SSR - - _DOUBLESIDED_ON - - _MASKMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 @@ -48,8 +43,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BumpMap: - m_Texture: {fileID: 8941042731460528134, guid: 3034a39973236e94e9df49e1d4459f9b, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _CoatMaskMap: @@ -101,8 +95,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 5237496738794762702, guid: 3034a39973236e94e9df49e1d4459f9b, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MaskMap: diff --git a/Assets/KoboldKare/Materials/EquineDildo.mat b/Assets/KoboldKare/Materials/EquineDildo.mat index b17fff712..06e0f4987 100644 --- a/Assets/KoboldKare/Materials/EquineDildo.mat +++ b/Assets/KoboldKare/Materials/EquineDildo.mat @@ -23,10 +23,7 @@ Material: m_Name: EquineDildo m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DEFORM_BALLS_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/FarmFence.mat b/Assets/KoboldKare/Materials/FarmFence.mat index 0d8ce22f1..d73d2d388 100644 --- a/Assets/KoboldKare/Materials/FarmFence.mat +++ b/Assets/KoboldKare/Materials/FarmFence.mat @@ -23,11 +23,7 @@ Material: m_Name: FarmFence m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Hay.mat b/Assets/KoboldKare/Materials/Hay.mat index 11df204ed..6e0d44077 100644 --- a/Assets/KoboldKare/Materials/Hay.mat +++ b/Assets/KoboldKare/Materials/Hay.mat @@ -23,9 +23,7 @@ Material: m_Name: Hay m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/HayTransparent.mat b/Assets/KoboldKare/Materials/HayTransparent.mat index 5c3f1109d..027585c0b 100644 --- a/Assets/KoboldKare/Materials/HayTransparent.mat +++ b/Assets/KoboldKare/Materials/HayTransparent.mat @@ -23,9 +23,7 @@ Material: m_Name: HayTransparent m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/HumanoidPenis.mat b/Assets/KoboldKare/Materials/HumanoidPenis.mat index ddb392525..8bfbe844a 100644 --- a/Assets/KoboldKare/Materials/HumanoidPenis.mat +++ b/Assets/KoboldKare/Materials/HumanoidPenis.mat @@ -23,10 +23,7 @@ Material: m_Name: HumanoidPenis m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DEFORM_BALLS_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/JapaneseBrick.mat b/Assets/KoboldKare/Materials/JapaneseBrick.mat index b8e64a587..ef48f12db 100644 --- a/Assets/KoboldKare/Materials/JapaneseBrick.mat +++ b/Assets/KoboldKare/Materials/JapaneseBrick.mat @@ -10,9 +10,7 @@ Material: m_Name: JapaneseBrick m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/KandiDickFlared.mat b/Assets/KoboldKare/Materials/KandiDickFlared.mat index 4eb382157..a8bf851e3 100644 --- a/Assets/KoboldKare/Materials/KandiDickFlared.mat +++ b/Assets/KoboldKare/Materials/KandiDickFlared.mat @@ -10,20 +10,7 @@ Material: m_Name: KandiDickFlared m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DEFORM_BALLS_ON - - _DISABLE_SSR - - _DISPLACEMENT_LOCK_TILING_SCALE - - _EMISSION - - _MASKMAP - - _MATERIAL_FEATURE_SUBSURFACE_SCATTERING - - _MATERIAL_FEATURE_TRANSMISSION - - _METALLICGLOSSMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE - - _THICKNESSMAP - - _VERTEX_DISPLACEMENT - - _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Kobold.mat b/Assets/KoboldKare/Materials/Kobold.mat index d2e471221..a8034071b 100644 --- a/Assets/KoboldKare/Materials/Kobold.mat +++ b/Assets/KoboldKare/Materials/Kobold.mat @@ -11,18 +11,8 @@ Material: m_Shader: {fileID: 4800000, guid: bc0a95306787ee14c8cba6b6697de1e1, type: 3} m_ValidKeywords: - _PENETRATION_DEFORMATION_DETAIL_ON - m_InvalidKeywords: - - _DISPLACEMENT_LOCK_TILING_SCALE - - _EMISSION - - _MASKMAP - - _MATERIAL_FEATURE_SUBSURFACE_SCATTERING - - _MATERIAL_FEATURE_TRANSMISSION - - _METALLICGLOSSMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE - - _THICKNESSMAP - - _VERTEX_DISPLACEMENT - - _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE + - _PENETRATION_DEFORMATION_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/KoboldDick.mat b/Assets/KoboldKare/Materials/KoboldDick.mat index 108a3c1d2..3007cb464 100644 --- a/Assets/KoboldKare/Materials/KoboldDick.mat +++ b/Assets/KoboldKare/Materials/KoboldDick.mat @@ -10,19 +10,7 @@ Material: m_Name: KoboldDick m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DISABLE_SSR - - _DISPLACEMENT_LOCK_TILING_SCALE - - _EMISSION - - _MASKMAP - - _MATERIAL_FEATURE_SUBSURFACE_SCATTERING - - _MATERIAL_FEATURE_TRANSMISSION - - _METALLICGLOSSMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE - - _THICKNESSMAP - - _VERTEX_DISPLACEMENT - - _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/KoboldEquine.mat b/Assets/KoboldKare/Materials/KoboldEquine.mat index b3a6def32..cb6b1e031 100644 --- a/Assets/KoboldKare/Materials/KoboldEquine.mat +++ b/Assets/KoboldKare/Materials/KoboldEquine.mat @@ -10,19 +10,7 @@ Material: m_Name: KoboldEquine m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DISABLE_SSR - - _DISPLACEMENT_LOCK_TILING_SCALE - - _EMISSION - - _MASKMAP - - _MATERIAL_FEATURE_SUBSURFACE_SCATTERING - - _MATERIAL_FEATURE_TRANSMISSION - - _METALLICGLOSSMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE - - _THICKNESSMAP - - _VERTEX_DISPLACEMENT - - _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/KoboldEyes.mat b/Assets/KoboldKare/Materials/KoboldEyes.mat index 4881b6e9b..d7a5e8450 100644 --- a/Assets/KoboldKare/Materials/KoboldEyes.mat +++ b/Assets/KoboldKare/Materials/KoboldEyes.mat @@ -10,9 +10,7 @@ Material: m_Name: KoboldEyes m_Shader: {fileID: 4800000, guid: 5e1d12dd9f331b94da153b99f92b9e11, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _ADD_PRECOMPUTED_VELOCITY - - _PENETRATION_DEFORMATION_DETAIL_ON + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/KoboldImposter.mat b/Assets/KoboldKare/Materials/KoboldImposter.mat deleted file mode 100644 index 528ab6bd4..000000000 --- a/Assets/KoboldKare/Materials/KoboldImposter.mat +++ /dev/null @@ -1,161 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-9024767206849970611 -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: 4 ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: KoboldImposter - m_Shader: {fileID: 4800000, guid: bc0a95306787ee14c8cba6b6697de1e1, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseColorMap: - m_Texture: {fileID: 2800000, guid: b667672561ded2d46bc52a17bb2f1dc6, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DecalColorMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MaskMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _NormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ThicknessMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _texcoord: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _AlphaCutoff: 0.5 - - _Blend: 0 - - _BoobLerp: 0 - - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 - - _Head: 1 - - _Metallic: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.005 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _Surface: 0 - - _TransAmbient: 0.1 - - _TransDirect: 0.9 - - _TransNormal: 0.5 - - _TransScattering: 2 - - _TransShadow: 0.5 - - _TransStrength: 1 - - _TransmissionShadow: 0.5 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {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} - - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - _SubsurfaceColor: {r: 0.8396226, g: 0.6059541, b: 0.6059541, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/KoboldKare/Materials/KoboldImposter.mat.meta b/Assets/KoboldKare/Materials/KoboldImposter.mat.meta deleted file mode 100644 index 6bd5ca05c..000000000 --- a/Assets/KoboldKare/Materials/KoboldImposter.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: df74c44db562364408c3fbb93892acce -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Materials/KoboldTapered.mat b/Assets/KoboldKare/Materials/KoboldTapered.mat index 3e4b8f6e1..8d345970a 100644 --- a/Assets/KoboldKare/Materials/KoboldTapered.mat +++ b/Assets/KoboldKare/Materials/KoboldTapered.mat @@ -10,9 +10,7 @@ Material: m_Name: KoboldTapered m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DISABLE_SSR - - _NORMALMAP_TANGENT_SPACE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Bark.mat b/Assets/KoboldKare/Materials/MapMaterials/Bark.mat index 2b05d937e..d98d38359 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Bark.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Bark.mat @@ -10,13 +10,7 @@ Material: m_Name: Bark m_Shader: {fileID: 4800000, guid: 1e9413cde3392d64184886f4f8a221bc, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - EFFECT_BUMP - - EFFECT_HUE_VARIATION - - _GLOSSYREFLECTIONS_OFF - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _WINDQUALITY_FAST + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/BigRock.mat b/Assets/KoboldKare/Materials/MapMaterials/BigRock.mat index 909151ae4..ff06149df 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/BigRock.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/BigRock.mat @@ -10,11 +10,7 @@ Material: m_Name: BigRock m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -154,6 +150,7 @@ Material: - _NORMALMAP: 1 - _OcclusionStrength: 1 - _Parallax: 0.005 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 0.05 diff --git a/Assets/KoboldKare/Materials/MapMaterials/BushyLeaf.mat b/Assets/KoboldKare/Materials/MapMaterials/BushyLeaf.mat index 5f6041c51..73a66d4f3 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/BushyLeaf.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/BushyLeaf.mat @@ -23,12 +23,7 @@ Material: m_Name: BushyLeaf m_Shader: {fileID: 4800000, guid: 42e0f16c77d25144ea2348ca1a254645, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - EFFECT_BUMP - - EFFECT_HUE_VARIATION - - EFFECT_SUBSURFACE - - _NORMALMAP - - _WINDQUALITY_FAST + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/CrystalHolder.mat b/Assets/KoboldKare/Materials/MapMaterials/CrystalHolder.mat index 3c8dab989..5b85a5f1c 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/CrystalHolder.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/CrystalHolder.mat @@ -23,11 +23,7 @@ Material: m_Name: CrystalHolder m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -119,6 +115,7 @@ Material: - _NORMALMAP: 1 - _OcclusionStrength: 1 - _Parallax: 0.005 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/DiscoloredRocks.mat b/Assets/KoboldKare/Materials/MapMaterials/DiscoloredRocks.mat index 76f3b6082..b21148bb2 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/DiscoloredRocks.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/DiscoloredRocks.mat @@ -23,12 +23,7 @@ Material: m_Name: DiscoloredRocks m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/KoboPillar.mat b/Assets/KoboldKare/Materials/MapMaterials/KoboPillar.mat index a9ee4ef7e..dbea0fd68 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/KoboPillar.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/KoboPillar.mat @@ -10,11 +10,7 @@ Material: m_Name: KoboPillar m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _METALLICGLOSSMAP_ON - - _NORMALMAP_ON - - _TERRAINBLEND_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Leaf (Snow).mat b/Assets/KoboldKare/Materials/MapMaterials/Leaf (Snow).mat index a9b339c59..17026c984 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Leaf (Snow).mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Leaf (Snow).mat @@ -23,13 +23,7 @@ Material: m_Name: Leaf (Snow) m_Shader: {fileID: 4800000, guid: 42e0f16c77d25144ea2348ca1a254645, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - EFFECT_BUMP - - EFFECT_HUE_VARIATION - - EFFECT_SUBSURFACE - - _ALPHATEST_ON - - _NORMALMAP - - _WINDQUALITY_FAST + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 @@ -87,6 +81,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 1 @@ -114,6 +120,7 @@ Material: - _Metallic: 0 - _NormalMapKwToggle: 1 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Saturation: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Leaf Static.mat b/Assets/KoboldKare/Materials/MapMaterials/Leaf Static.mat index 1715ffa93..b2594b661 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Leaf Static.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Leaf Static.mat @@ -23,9 +23,7 @@ Material: m_Name: Leaf Static m_Shader: {fileID: 4800000, guid: 42e0f16c77d25144ea2348ca1a254645, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _ALPHATEST_ON - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 @@ -171,6 +169,18 @@ Material: 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: - _AO: 2.4 @@ -212,6 +222,7 @@ Material: - _NumLayersCount: 1 - _Occlusion: 7.5 - _OcclusionStrength: 0.928 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Saturation: 1.4 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Leaf.mat b/Assets/KoboldKare/Materials/MapMaterials/Leaf.mat index f18e73ec5..5470ca678 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Leaf.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Leaf.mat @@ -23,8 +23,7 @@ Material: m_Name: Leaf m_Shader: {fileID: 4800000, guid: 42e0f16c77d25144ea2348ca1a254645, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/LimestonyRock.mat b/Assets/KoboldKare/Materials/MapMaterials/LimestonyRock.mat index 6a3e286ba..dc84dd06f 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/LimestonyRock.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/LimestonyRock.mat @@ -10,9 +10,7 @@ Material: m_Name: LimestonyRock m_Shader: {fileID: 4800000, guid: 9518223a6f4890b49bd34b6ba19ab433, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _TERRAINBLEND_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/LimestonyRockNoBlend.mat b/Assets/KoboldKare/Materials/MapMaterials/LimestonyRockNoBlend.mat index 5d5df4a65..7c626d97c 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/LimestonyRockNoBlend.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/LimestonyRockNoBlend.mat @@ -10,8 +10,7 @@ Material: m_Name: LimestonyRockNoBlend m_Shader: {fileID: 4800000, guid: 9518223a6f4890b49bd34b6ba19ab433, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat b/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat deleted file mode 100644 index aad506caa..000000000 --- a/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat +++ /dev/null @@ -1,160 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Nature Rock (Surf) - m_Shader: {fileID: 4800000, guid: 9518223a6f4890b49bd34b6ba19ab433, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BaseColorMap: - m_Texture: {fileID: 2800000, guid: 36745b079f648864dba66ab50698703d, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BaseMap: - m_Texture: {fileID: 2800000, guid: 6fe5b09e64e04394e8d00a77f03db3e6, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 2800000, guid: 45af0db8bf745f940a3f39ef79b2af59, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _Data: - m_Texture: {fileID: 2800000, guid: 2d98449520e2b0d4394830743dfc5e41, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DecalColorMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 2800000, guid: 6fe5b09e64e04394e8d00a77f03db3e6, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 2800000, guid: 0555d539795ea3d4e8e7eaddd6ff0eb5, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _Normal: - m_Texture: {fileID: 2800000, guid: 6a9beba5e8d60d94e9b691f1f1887773, type: 3} - 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} - - _Roughness: - m_Texture: {fileID: 2800000, guid: f1e78584572605f43b264807974023f3, type: 3} - 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} - - _texcoord: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _AlphaCutoff: 0.5 - - _Blend: 0 - - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _EdgeStrength: 0.4 - - _Emissive: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 - - _METALLICGLOSSMAP: 1 - - _Metallic: 1 - - _NORMALMAP: 1 - - _OcclusionStrength: 1 - - _Parallax: 0.005 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _SmoothPower: 1 - - _Smoothness: 1 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _Surface: 0 - - _Tiling: 0.1 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {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} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] ---- !u!114 &4342176926647379026 -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: 4 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat.meta b/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat.meta deleted file mode 100644 index 0c62f1885..000000000 --- a/Assets/KoboldKare/Materials/MapMaterials/Nature Rock (Surf).mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9e32be5c3007f174e8cc508bd64fac55 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Materials/MapMaterials/Rocks.mat b/Assets/KoboldKare/Materials/MapMaterials/Rocks.mat index 00c4fd500..c80dfbf0a 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Rocks.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Rocks.mat @@ -23,12 +23,7 @@ Material: m_Name: Rocks m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Roof_slate.mat b/Assets/KoboldKare/Materials/MapMaterials/Roof_slate.mat index eece5d8b0..b39de84cc 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Roof_slate.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Roof_slate.mat @@ -23,11 +23,7 @@ Material: m_Name: Roof_slate m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -117,6 +113,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -138,6 +146,7 @@ Material: - _Metallic: 1 - _NORMALMAP: 1 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/Woodplank (Snow).mat b/Assets/KoboldKare/Materials/MapMaterials/Woodplank (Snow).mat index b22bbed28..58c3337d6 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/Woodplank (Snow).mat +++ b/Assets/KoboldKare/Materials/MapMaterials/Woodplank (Snow).mat @@ -23,11 +23,7 @@ Material: m_Name: Woodplank (Snow) m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal.mat b/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal.mat index d360e1de5..fbada05d3 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal.mat @@ -23,12 +23,7 @@ Material: m_Name: bricks_gunmetal m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal_sm.mat b/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal_sm.mat index 4900a1974..3951ad2ce 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal_sm.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/bricks_gunmetal_sm.mat @@ -23,12 +23,7 @@ Material: m_Name: bricks_gunmetal_sm m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/ceramic_bouncy.mat b/Assets/KoboldKare/Materials/MapMaterials/ceramic_bouncy.mat index bbc0e4d19..384870fde 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/ceramic_bouncy.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/ceramic_bouncy.mat @@ -10,9 +10,7 @@ Material: m_Name: ceramic_bouncy m_Shader: {fileID: 4800000, guid: 10580ed660303c842a56c89c50da4782, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles.mat b/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles.mat index 7ee83335f..733727971 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles.mat @@ -10,9 +10,7 @@ Material: m_Name: ceramic_tiles m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles_lg.mat b/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles_lg.mat index 9fe2b9f93..3db704c3a 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles_lg.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/ceramic_tiles_lg.mat @@ -10,10 +10,7 @@ Material: m_Name: ceramic_tiles_lg m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -107,6 +104,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -129,6 +138,7 @@ Material: - _Metallic: 1 - _NORMALMAP: 1 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte.mat b/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte.mat index 0f45313fd..5465b6dc2 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte.mat @@ -10,11 +10,7 @@ Material: m_Name: concrete_polished_matte m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte_small.mat b/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte_small.mat index 512929781..2568d138b 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte_small.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/concrete_polished_matte_small.mat @@ -10,11 +10,7 @@ Material: m_Name: concrete_polished_matte_small m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft.mat b/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft.mat index c571b05b6..e2aa6bb44 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft.mat @@ -23,11 +23,7 @@ Material: m_Name: concrete_raw_soft m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft_big.mat b/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft_big.mat index a3edd2ec4..2dabc664a 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft_big.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/concrete_raw_soft_big.mat @@ -23,11 +23,7 @@ Material: m_Name: concrete_raw_soft_big m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/metal_vent.mat b/Assets/KoboldKare/Materials/MapMaterials/metal_vent.mat index 4002dd3f6..36c950cc2 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/metal_vent.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/metal_vent.mat @@ -23,11 +23,7 @@ Material: m_Name: metal_vent m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -113,6 +109,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -134,6 +142,7 @@ Material: - _Metallic: 1 - _NORMALMAP: 1 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/parisian_sidewalk.mat b/Assets/KoboldKare/Materials/MapMaterials/parisian_sidewalk.mat index 639e6c390..d5fdd0a26 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/parisian_sidewalk.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/parisian_sidewalk.mat @@ -10,11 +10,7 @@ Material: m_Name: parisian_sidewalk m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/parquet_wood.mat b/Assets/KoboldKare/Materials/MapMaterials/parquet_wood.mat index bd11b02c0..b28cebf15 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/parquet_wood.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/parquet_wood.mat @@ -10,11 +10,7 @@ Material: m_Name: parquet_wood m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/pebble_rich_concrete.mat b/Assets/KoboldKare/Materials/MapMaterials/pebble_rich_concrete.mat index b07ffd395..b3f0b52ae 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/pebble_rich_concrete.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/pebble_rich_concrete.mat @@ -10,11 +10,7 @@ Material: m_Name: pebble_rich_concrete m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/plaster_acoustic.mat b/Assets/KoboldKare/Materials/MapMaterials/plaster_acoustic.mat index e3b9859b5..6af42d8a2 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/plaster_acoustic.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/plaster_acoustic.mat @@ -10,11 +10,7 @@ Material: m_Name: plaster_acoustic m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/plastic_brushed.mat b/Assets/KoboldKare/Materials/MapMaterials/plastic_brushed.mat index 0fc19cede..2c2ded54b 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/plastic_brushed.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/plastic_brushed.mat @@ -10,9 +10,7 @@ Material: m_Name: plastic_brushed m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/stucco_white.mat b/Assets/KoboldKare/Materials/MapMaterials/stucco_white.mat index 8947a2f2e..f136a8bdd 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/stucco_white.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/stucco_white.mat @@ -10,12 +10,7 @@ Material: m_Name: stucco_white m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/stylized_chantily_wood.mat b/Assets/KoboldKare/Materials/MapMaterials/stylized_chantily_wood.mat index 994d7b86f..1f52a3467 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/stylized_chantily_wood.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/stylized_chantily_wood.mat @@ -23,11 +23,7 @@ Material: m_Name: stylized_chantily_wood m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -121,6 +117,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -142,6 +150,7 @@ Material: - _Metallic: 1 - _NORMALMAP: 1 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/stylized_wood.mat b/Assets/KoboldKare/Materials/MapMaterials/stylized_wood.mat index b686d79f8..db562e57f 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/stylized_wood.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/stylized_wood.mat @@ -23,12 +23,7 @@ Material: m_Name: stylized_wood m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/tempered_steel.mat b/Assets/KoboldKare/Materials/MapMaterials/tempered_steel.mat index 982a7a8ed..0e250703c 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/tempered_steel.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/tempered_steel.mat @@ -10,11 +10,7 @@ Material: m_Name: tempered_steel m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete.mat b/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete.mat index 71a4e51d1..e3ceaebeb 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete.mat @@ -10,11 +10,7 @@ Material: m_Name: trowled_concrete m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete_lg.mat b/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete_lg.mat index 89df078ec..ffbe5f2c9 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete_lg.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/trowled_concrete_lg.mat @@ -10,9 +10,7 @@ Material: m_Name: trowled_concrete_lg m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/MapMaterials/volga_blue.mat b/Assets/KoboldKare/Materials/MapMaterials/volga_blue.mat index 10c375e61..9bc6ad639 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/volga_blue.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/volga_blue.mat @@ -10,9 +10,7 @@ Material: m_Name: volga_blue m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -62,6 +60,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -77,6 +87,7 @@ Material: - _GlossyReflections: 0 - _Metallic: 0 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/MapMaterials/zinc_roofing.mat b/Assets/KoboldKare/Materials/MapMaterials/zinc_roofing.mat index 961e3ea92..394f14f98 100644 --- a/Assets/KoboldKare/Materials/MapMaterials/zinc_roofing.mat +++ b/Assets/KoboldKare/Materials/MapMaterials/zinc_roofing.mat @@ -23,11 +23,7 @@ Material: m_Name: zinc_roofing m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Mirrors.mat b/Assets/KoboldKare/Materials/Mirrors.mat deleted file mode 100644 index b6c0474aa..000000000 --- a/Assets/KoboldKare/Materials/Mirrors.mat +++ /dev/null @@ -1,141 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-4209422802646816883 -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: 1 ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Mirrors - m_Shader: {fileID: 4800000, guid: f3eb94885c6507b4f8064bffd462d7fa, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _AnisotropyMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ClearCoatMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DirectionMap: - 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} - - _LocalReflectionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MirrorSmudges: - m_Texture: {fileID: 2800000, guid: 961b1f03e69cf2344a5d9e8dae0fd396, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _NormalMap: - m_Texture: {fileID: 2800000, guid: 871220547319b7a40b1a34c6b6c40667, type: 3} - 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} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SubsurfaceMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ThicknessMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _texcoord: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _AlphaClip: 0 - - _AlphaCutoff: 0.5 - - _Anisotropy: 0 - - _Blend: 0 - - _BumpScale: 1 - - _ClearCoat: 1 - - _ClearCoatSmoothness: 0.5 - - _Cull: 2 - - _Cutoff: 0.5 - - _DstBlend: 0 - - _EnableAnisotropy: 0 - - _EnableClearCoat: 0 - - _EnableSubsurface: 0 - - _EnableToonReflections: 0 - - _EnableTransmission: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 - - _Metallic: 1 - - _NormalWarping: 0.15 - - _OcclusionStrength: 1 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _ReflectionSteps: 16 - - _Smoothness: 0.918 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _Surface: 0 - - _Thickness: 0.5 - - _WorkflowMode: 1 - - _ZWrite: 1 - m_Colors: - - _BaseColor: {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} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - _SubsurfaceColor: {r: 1, g: 1, b: 1, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/KoboldKare/Materials/Mirrors.mat.meta b/Assets/KoboldKare/Materials/Mirrors.mat.meta deleted file mode 100644 index df9c1c4d0..000000000 --- a/Assets/KoboldKare/Materials/Mirrors.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6679b458fc7d6364aa0727fdf5416657 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Materials/NipplePiercingMaterials.mat b/Assets/KoboldKare/Materials/NipplePiercingMaterials.mat index 3e3bffeec..9597ceb57 100644 --- a/Assets/KoboldKare/Materials/NipplePiercingMaterials.mat +++ b/Assets/KoboldKare/Materials/NipplePiercingMaterials.mat @@ -21,7 +21,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: NipplePiercingMaterials - m_Shader: {fileID: 4800000, guid: 99d74aa18adfe114b8db023429c25ed2, type: 3} + m_Shader: {fileID: 4800000, guid: bc0a95306787ee14c8cba6b6697de1e1, type: 3} m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 @@ -33,6 +33,10 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BaseMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -41,6 +45,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _DecalColorMap: + 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} @@ -49,6 +57,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _DetailMaskMap: + 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} @@ -61,10 +73,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 2800000, guid: 39bf2e4b19b7c1b4ca7e4c38efc9a01f, 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} + - _NormalMap: + 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} @@ -77,6 +97,14 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _texcoord: + 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} @@ -94,20 +122,28 @@ Material: - _AlphaClip: 0 - _AlphaCutoff: 0.5 - _Blend: 0 + - _BoobLerp: 0 - _BumpScale: 1 - _ClearCoatMask: 0 - _ClearCoatSmoothness: 0 + - _CompressibleDistance: 0 - _Cull: 2 - _Cutoff: 0.5 - _DetailAlbedoMapScale: 1 + - _DetailAlpha: 1 - _DetailNormalMapScale: 1 + - _DetailNormalScale: 1 + - _DetailTiling: 3 - _DstBlend: 0 - _EnvironmentReflections: 1 - _GlossMapScale: 0 - _Glossiness: 0 - _GlossyReflections: 0 + - _Head: 1 - _Metallic: 1 - _OcclusionStrength: 1 + - _PENETRATION_DEFORMATION: 0 + - _PENETRATION_DEFORMATION_DETAIL: 0 - _Parallax: 0.005 - _QueueControl: 0 - _QueueOffset: 0 @@ -117,11 +153,20 @@ Material: - _SpecularHighlights: 1 - _SrcBlend: 1 - _Surface: 0 + - _TransAmbient: 0.1 + - _TransDirect: 0.9 + - _TransNormal: 0.5 + - _TransScattering: 2 + - _TransShadow: 0.5 + - _TransStrength: 1 + - _TransmissionShadow: 0.5 - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 0.5943396, g: 0.5943396, b: 0.5943396, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _SubsurfaceColor: {r: 0.8396226, g: 0.6059541, b: 0.6059541, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/KoboldKare/Materials/NipplePumpGlossy.mat b/Assets/KoboldKare/Materials/NipplePumpGlossy.mat index ceb0e85c3..d4309807c 100644 --- a/Assets/KoboldKare/Materials/NipplePumpGlossy.mat +++ b/Assets/KoboldKare/Materials/NipplePumpGlossy.mat @@ -21,7 +21,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: NipplePumpGlossy - m_Shader: {fileID: 4800000, guid: 99d74aa18adfe114b8db023429c25ed2, type: 3} + m_Shader: {fileID: 4800000, guid: bc0a95306787ee14c8cba6b6697de1e1, type: 3} m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 @@ -33,6 +33,10 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 7a170cdb7cc88024cb628cfcdbb6705c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BaseMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -41,6 +45,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _DecalColorMap: + 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} @@ -49,6 +57,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _DetailMaskMap: + 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} @@ -61,6 +73,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 2800000, guid: cd8359fb330292a48a873580fa6b7df9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _Matcap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -69,6 +85,10 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _NormalMap: + 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} @@ -81,6 +101,14 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _texcoord: + 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} @@ -98,21 +126,29 @@ Material: - _AlphaClip: 0 - _AlphaCutoff: 0.5 - _Blend: 0 + - _BoobLerp: 0 - _BumpScale: 1 - _ClearCoatMask: 0 - _ClearCoatSmoothness: 0 + - _CompressibleDistance: 0 - _Cull: 2 - _Cutoff: 0.5 - _DetailAlbedoMapScale: 1 + - _DetailAlpha: 1 - _DetailNormalMapScale: 1 + - _DetailNormalScale: 1 + - _DetailTiling: 3 - _Distortion: 0.5 - _DstBlend: 0 - _EnvironmentReflections: 1 - _GlossMapScale: 0 - _Glossiness: 0 - _GlossyReflections: 0 + - _Head: 1 - _Metallic: 0 - _OcclusionStrength: 1 + - _PENETRATION_DEFORMATION: 0 + - _PENETRATION_DEFORMATION_DETAIL: 0 - _Parallax: 0.005 - _QueueControl: 0 - _QueueOffset: 0 @@ -122,6 +158,13 @@ Material: - _SpecularHighlights: 1 - _SrcBlend: 1 - _Surface: 0 + - _TransAmbient: 0.1 + - _TransDirect: 0.9 + - _TransNormal: 0.5 + - _TransScattering: 2 + - _TransShadow: 0.5 + - _TransStrength: 1 + - _TransmissionShadow: 0.5 - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: @@ -129,5 +172,7 @@ Material: - _Color: {r: 0.14150941, g: 0.14150941, b: 0.14150941, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _GlassColor: {r: 0, g: 0.4788829, b: 0.7830188, a: 0} + - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _SubsurfaceColor: {r: 0.8396226, g: 0.6059541, b: 0.6059541, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/KoboldKare/Materials/Pawnshop/BigConcreteTile.mat b/Assets/KoboldKare/Materials/Pawnshop/BigConcreteTile.mat index ade909a69..8c1a03517 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/BigConcreteTile.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/BigConcreteTile.mat @@ -9,13 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: BigConcreteTile m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - - _SPECULARHIGHLIGHTS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CarBattery.mat b/Assets/KoboldKare/Materials/Pawnshop/CarBattery.mat index ce52e3afa..8933c9bfc 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CarBattery.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CarBattery.mat @@ -9,13 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: CarBattery m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CardboardBoxLarge.mat b/Assets/KoboldKare/Materials/Pawnshop/CardboardBoxLarge.mat index e246c1f4d..341f9568a 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CardboardBoxLarge.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CardboardBoxLarge.mat @@ -9,12 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: CardboardBoxLarge m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CardboardClusters.mat b/Assets/KoboldKare/Materials/Pawnshop/CardboardClusters.mat index e7c24b11a..cc68b9802 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CardboardClusters.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CardboardClusters.mat @@ -22,13 +22,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: CardboardClusters m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CargoContainer.mat b/Assets/KoboldKare/Materials/Pawnshop/CargoContainer.mat index d6ea25a07..9c86665c2 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CargoContainer.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CargoContainer.mat @@ -10,10 +10,7 @@ Material: m_Name: CargoContainer m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/ConcreteWall.mat b/Assets/KoboldKare/Materials/Pawnshop/ConcreteWall.mat index 27bc20366..7c205f307 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/ConcreteWall.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/ConcreteWall.mat @@ -23,13 +23,7 @@ Material: m_Name: ConcreteWall m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CrystalA.mat b/Assets/KoboldKare/Materials/Pawnshop/CrystalA.mat index 88612a488..1376c23dc 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CrystalA.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CrystalA.mat @@ -23,11 +23,7 @@ Material: m_Name: CrystalA m_Shader: {fileID: 4800000, guid: 9518223a6f4890b49bd34b6ba19ab433, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/CrystalB.mat b/Assets/KoboldKare/Materials/Pawnshop/CrystalB.mat index ba4a732d6..793e7f944 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/CrystalB.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/CrystalB.mat @@ -23,12 +23,7 @@ Material: m_Name: CrystalB m_Shader: {fileID: 4800000, guid: 9518223a6f4890b49bd34b6ba19ab433, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _OCCLUSIONMAP - - _RECEIVE_SHADOWS_OFF + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/GlossyLightTile.mat b/Assets/KoboldKare/Materials/Pawnshop/GlossyLightTile.mat index 7b22b8ab5..7576ee7ba 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/GlossyLightTile.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/GlossyLightTile.mat @@ -23,9 +23,7 @@ Material: m_Name: GlossyLightTile m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -67,6 +65,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: - _AlphaClip: 0 @@ -82,6 +92,7 @@ Material: - _GlossyReflections: 0 - _Metallic: 0.545 - _OcclusionStrength: 1 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 0.727 diff --git a/Assets/KoboldKare/Materials/Pawnshop/LargeTruss.mat b/Assets/KoboldKare/Materials/Pawnshop/LargeTruss.mat index b9c012925..6b30306c4 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/LargeTruss.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/LargeTruss.mat @@ -10,10 +10,7 @@ Material: m_Name: LargeTruss m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/MetalBarsSemirusted.mat b/Assets/KoboldKare/Materials/Pawnshop/MetalBarsSemirusted.mat index 3af4857d0..cac50d8ad 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/MetalBarsSemirusted.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/MetalBarsSemirusted.mat @@ -23,11 +23,7 @@ Material: m_Name: MetalBarsSemirusted m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/MetalBeams.mat b/Assets/KoboldKare/Materials/Pawnshop/MetalBeams.mat index 59f665578..163045e76 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/MetalBeams.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/MetalBeams.mat @@ -9,14 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: MetalBeams m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/MetalBunkerDoor.mat b/Assets/KoboldKare/Materials/Pawnshop/MetalBunkerDoor.mat index c02b6fee8..3e72e8050 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/MetalBunkerDoor.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/MetalBunkerDoor.mat @@ -22,13 +22,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: MetalBunkerDoor m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/PipeCopper.mat b/Assets/KoboldKare/Materials/Pawnshop/PipeCopper.mat index d93c6c953..009a9638c 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/PipeCopper.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/PipeCopper.mat @@ -9,11 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: PipeCopper m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/PipeNormal.mat b/Assets/KoboldKare/Materials/Pawnshop/PipeNormal.mat index d14bd6d57..c2bcc19ab 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/PipeNormal.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/PipeNormal.mat @@ -9,11 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: PipeNormal m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/PipeRusted.mat b/Assets/KoboldKare/Materials/Pawnshop/PipeRusted.mat index ee9227ca7..e67186844 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/PipeRusted.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/PipeRusted.mat @@ -9,11 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: PipeRusted m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/PipeRusted2.mat b/Assets/KoboldKare/Materials/Pawnshop/PipeRusted2.mat index ac1bf2ba5..d4f8c9797 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/PipeRusted2.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/PipeRusted2.mat @@ -10,9 +10,7 @@ Material: m_Name: PipeRusted2 m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/RopeCrystal.mat b/Assets/KoboldKare/Materials/Pawnshop/RopeCrystal.mat index 1fb31fe16..acf24380b 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/RopeCrystal.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/RopeCrystal.mat @@ -10,12 +10,7 @@ Material: m_Name: RopeCrystal m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/StonePedestal.mat b/Assets/KoboldKare/Materials/Pawnshop/StonePedestal.mat index 9de501f9a..a17481fe8 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/StonePedestal.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/StonePedestal.mat @@ -22,11 +22,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: StonePedestal m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _NORMALMAP - - _OCCLUSIONMAP + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/StoreMax5000.mat b/Assets/KoboldKare/Materials/Pawnshop/StoreMax5000.mat index e0dcc64d2..019227cdb 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/StoreMax5000.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/StoreMax5000.mat @@ -10,12 +10,7 @@ Material: m_Name: StoreMax5000 m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/Trashcan.mat b/Assets/KoboldKare/Materials/Pawnshop/Trashcan.mat index 83c6b1ee2..b7d087394 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/Trashcan.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/Trashcan.mat @@ -10,12 +10,7 @@ Material: m_Name: Trashcan m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON - - _OCCLUSIONMAP + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Pawnshop/decal_noRefunds.mat b/Assets/KoboldKare/Materials/Pawnshop/decal_noRefunds.mat index 6435f7153..afcc63153 100644 --- a/Assets/KoboldKare/Materials/Pawnshop/decal_noRefunds.mat +++ b/Assets/KoboldKare/Materials/Pawnshop/decal_noRefunds.mat @@ -22,10 +22,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: decal_noRefunds m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} - m_ValidKeywords: - - _ENVIRONMENTREFLECTIONS_OFF - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeCircleDoor.mat b/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeCircleDoor.mat index eb4ef19b0..23b255c54 100644 --- a/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeCircleDoor.mat +++ b/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeCircleDoor.mat @@ -10,11 +10,7 @@ Material: m_Name: PlayerHomeCircleDoor m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -106,6 +102,7 @@ Material: - _NORMALMAP: 1 - _OcclusionStrength: 1 - _Parallax: 0.005 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeTatami.mat b/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeTatami.mat index ae20d7b41..6326b9752 100644 --- a/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeTatami.mat +++ b/Assets/KoboldKare/Materials/PlayerHome/PlayerHomeTatami.mat @@ -23,11 +23,7 @@ Material: m_Name: PlayerHomeTatami m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/PlayerHome/PlayerHouse.mat b/Assets/KoboldKare/Materials/PlayerHome/PlayerHouse.mat index bb4a47833..07dc762a1 100644 --- a/Assets/KoboldKare/Materials/PlayerHome/PlayerHouse.mat +++ b/Assets/KoboldKare/Materials/PlayerHome/PlayerHouse.mat @@ -10,11 +10,7 @@ Material: m_Name: PlayerHouse m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -106,6 +102,7 @@ Material: - _NORMALMAP: 1 - _OcclusionStrength: 1 - _Parallax: 0.005 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/PondWater.mat b/Assets/KoboldKare/Materials/PondWater.mat index 9c2b69edc..f47aadf63 100644 --- a/Assets/KoboldKare/Materials/PondWater.mat +++ b/Assets/KoboldKare/Materials/PondWater.mat @@ -10,10 +10,7 @@ Material: m_Name: PondWater m_Shader: {fileID: 4800000, guid: a9cde6543f2604b4cbd3023847cb9c0b, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/RunningWaterAgain.mat b/Assets/KoboldKare/Materials/RunningWaterAgain.mat index 1361eaafd..678ac123b 100644 --- a/Assets/KoboldKare/Materials/RunningWaterAgain.mat +++ b/Assets/KoboldKare/Materials/RunningWaterAgain.mat @@ -10,10 +10,7 @@ Material: m_Name: RunningWaterAgain m_Shader: {fileID: 4800000, guid: a9cde6543f2604b4cbd3023847cb9c0b, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/SeaWater.mat b/Assets/KoboldKare/Materials/SeaWater.mat index 40eaac3e6..47da08ef8 100644 --- a/Assets/KoboldKare/Materials/SeaWater.mat +++ b/Assets/KoboldKare/Materials/SeaWater.mat @@ -10,10 +10,7 @@ Material: m_Name: SeaWater m_Shader: {fileID: 4800000, guid: a9cde6543f2604b4cbd3023847cb9c0b, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/SeedExtractor 1.mat b/Assets/KoboldKare/Materials/SeedExtractor 1.mat index 43a5e7338..376fbcb69 100644 --- a/Assets/KoboldKare/Materials/SeedExtractor 1.mat +++ b/Assets/KoboldKare/Materials/SeedExtractor 1.mat @@ -10,11 +10,7 @@ Material: m_Name: SeedExtractor 1 m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/SellDumpsterA.mat b/Assets/KoboldKare/Materials/SellDumpsterA.mat index 43cd16e39..3ad75e8ab 100644 --- a/Assets/KoboldKare/Materials/SellDumpsterA.mat +++ b/Assets/KoboldKare/Materials/SellDumpsterA.mat @@ -10,11 +10,7 @@ Material: m_Name: SellDumpsterA m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/SellDumpsterB.mat b/Assets/KoboldKare/Materials/SellDumpsterB.mat index 30e4b98a4..8556c1afe 100644 --- a/Assets/KoboldKare/Materials/SellDumpsterB.mat +++ b/Assets/KoboldKare/Materials/SellDumpsterB.mat @@ -10,11 +10,7 @@ Material: m_Name: SellDumpsterB m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Signpost_Kobold.mat b/Assets/KoboldKare/Materials/Signpost_Kobold.mat index b71169b49..be0e963e8 100644 --- a/Assets/KoboldKare/Materials/Signpost_Kobold.mat +++ b/Assets/KoboldKare/Materials/Signpost_Kobold.mat @@ -10,11 +10,7 @@ Material: m_Name: Signpost_Kobold m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -106,6 +102,7 @@ Material: - _NORMALMAP: 1 - _OcclusionStrength: 1 - _Parallax: 0.005 + - _QueueControl: 0 - _QueueOffset: 0 - _ReceiveShadows: 1 - _Smoothness: 1 diff --git a/Assets/KoboldKare/Materials/Silicone.mat b/Assets/KoboldKare/Materials/Silicone.mat index 2f847f417..46fbb2934 100644 --- a/Assets/KoboldKare/Materials/Silicone.mat +++ b/Assets/KoboldKare/Materials/Silicone.mat @@ -11,18 +11,7 @@ Material: m_Shader: {fileID: 4800000, guid: bc0a95306787ee14c8cba6b6697de1e1, type: 3} m_ValidKeywords: - _PENETRATION_DEFORMATION_ON - m_InvalidKeywords: - - _DISPLACEMENT_LOCK_TILING_SCALE - - _EMISSION - - _MASKMAP - - _MATERIAL_FEATURE_SUBSURFACE_SCATTERING - - _MATERIAL_FEATURE_TRANSMISSION - - _METALLICGLOSSMAP - - _NORMALMAP - - _NORMALMAP_TANGENT_SPACE - - _THICKNESSMAP - - _VERTEX_DISPLACEMENT - - _VERTEX_DISPLACEMENT_LOCK_OBJECT_SCALE + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/StillWater.mat b/Assets/KoboldKare/Materials/StillWater.mat index 1a0d4dc65..c27151967 100644 --- a/Assets/KoboldKare/Materials/StillWater.mat +++ b/Assets/KoboldKare/Materials/StillWater.mat @@ -10,10 +10,7 @@ Material: m_Name: StillWater m_Shader: {fileID: 4800000, guid: a9cde6543f2604b4cbd3023847cb9c0b, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/TaperedDildo.mat b/Assets/KoboldKare/Materials/TaperedDildo.mat index 7859061cf..25d81e26b 100644 --- a/Assets/KoboldKare/Materials/TaperedDildo.mat +++ b/Assets/KoboldKare/Materials/TaperedDildo.mat @@ -23,9 +23,7 @@ Material: m_Name: TaperedDildo m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DEFORM_BALLS_ON - - _INVISIBLE_WHEN_INSIDE_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Materials/Tentacle.mat b/Assets/KoboldKare/Materials/Tentacle.mat index d4ba4dcbf..3f40bfee9 100644 --- a/Assets/KoboldKare/Materials/Tentacle.mat +++ b/Assets/KoboldKare/Materials/Tentacle.mat @@ -10,8 +10,7 @@ Material: m_Name: Tentacle m_Shader: {fileID: 4800000, guid: a3a4b45780bd450459e93b3068a3fdf5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _DEFORM_BALLS_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -69,6 +68,18 @@ Material: 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: - _AlphaCutoff: 0.5 @@ -84,7 +95,10 @@ Material: - _DeformBalls: 0 - _DetailNormalMapScale: 1 - _DickLength: 1.5083696 + - _DickWorldLength: 1 + - _DistanceToHole: 0 - _DstBlend: 0 + - _EndClip: 0 - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 @@ -106,19 +120,27 @@ Material: - _PenetratorLength: 3.225988 - _PenetratorSquishPullAmount: 0 - _PinchBuffer: 0.25 + - _QueueControl: 0 + - _QueueOffset: 0 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 + - _SquashStretchCorrection: 1 - _SquishPullAmount: 0 - _SrcBlend: 1 + - _StartClip: 0 - _UVSec: 0 - _ZWrite: 1 - __dirty: 0 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _DickForward: {r: 0.0000000066429475, g: 1, b: 0.00000017881396, a: 0} + - _DickForwardWorld: {r: 0, g: 0, b: 0, a: 0} - _DickOrigin: {r: 0.00000160361, g: 0.0035360164, b: -0.0000009092179, a: 0} - _DickRight: {r: 1, g: -0.000000011156064, b: 0, a: 0} + - _DickRightWorld: {r: 0, g: 0, b: 0, a: 0} + - _DickRootWorld: {r: 0, g: 0, b: 0, a: 0} - _DickUp: {r: -5.308339e-16, g: -0.00000017881396, b: 1, a: 0} + - _DickUpWorld: {r: 0, g: 0, b: 0, a: 0} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - _OrifaceOutWorldNormal: {r: 0, g: 1, b: 0, a: 0} diff --git a/Assets/KoboldKare/Materials/WaterFall.mat b/Assets/KoboldKare/Materials/WaterFall.mat index d3a59555a..c6da2ecf5 100644 --- a/Assets/KoboldKare/Materials/WaterFall.mat +++ b/Assets/KoboldKare/Materials/WaterFall.mat @@ -10,10 +10,7 @@ Material: m_Name: WaterFall m_Shader: {fileID: 4800000, guid: 00cc85f47480090458cd54eef2940f37, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _BLENDMODE_ALPHA - - _ENABLE_FOG_ON_TRANSPARENT - - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Scenes/MainMap.unity b/Assets/KoboldKare/Scenes/MainMap.unity index 91d455929..e31208af3 100644 --- a/Assets/KoboldKare/Scenes/MainMap.unity +++ b/Assets/KoboldKare/Scenes/MainMap.unity @@ -192051,6 +192051,53 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1172689564} m_PrefabAsset: {fileID: 0} +--- !u!28 &1174240676 +Texture2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Lightning_PositionMap + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + m_IsAlphaChannelOptional: 0 + serializedVersion: 2 + m_Width: 8 + m_Height: 1 + m_CompleteImageSize: 128 + m_MipsStripped: 0 + m_TextureFormat: 20 + m_MipCount: 1 + m_IsReadable: 1 + m_IsPreProcessed: 0 + m_IgnoreMasterTextureLimit: 0 + m_StreamingMipmaps: 0 + m_StreamingMipmapsPriority: 0 + m_VTOnly: 0 + m_AlphaIsTransparency: 0 + m_ImageCount: 1 + m_TextureDimension: 2 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 0 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 0 + m_WrapV: 0 + m_WrapW: 0 + m_LightmapFormat: 0 + m_ColorSpace: 0 + m_PlatformBlob: + image data: 128 + _typelessdata: 9af967c3f0522742d6c32c430000803f736868c3fb292c42e07a2e430000803ff8136ac380152a42d6632d430000803f21f06ac3420b304270fd2a430000803f4a8c67c361903742f5282b430000803f879664c394c33142d6632e430000803fd90e63c3d2cd314214ee2c430000803f540365c3d24d2742a9d12c430000803f + m_StreamData: + serializedVersion: 2 + offset: 0 + size: 0 + path: --- !u!4 &1176359493 stripped Transform: m_CorrespondingSourceObject: {fileID: 7239969446039512633, guid: c33c6a145d6e19c46a6b91e2c691edae, @@ -214719,53 +214766,6 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c13d46b188b3b8a428a5a5fbfc950aaf, type: 3} ---- !u!28 &1317541232 -Texture2D: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Lightning_PositionMap - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_ForcedFallbackFormat: 4 - m_DownscaleFallback: 0 - m_IsAlphaChannelOptional: 0 - serializedVersion: 2 - m_Width: 8 - m_Height: 1 - m_CompleteImageSize: 128 - m_MipsStripped: 0 - m_TextureFormat: 20 - m_MipCount: 1 - m_IsReadable: 1 - m_IsPreProcessed: 0 - m_IgnoreMasterTextureLimit: 0 - m_StreamingMipmaps: 0 - m_StreamingMipmapsPriority: 0 - m_VTOnly: 0 - m_AlphaIsTransparency: 0 - m_ImageCount: 1 - m_TextureDimension: 2 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 0 - m_Aniso: 1 - m_MipBias: 0 - m_WrapU: 0 - m_WrapV: 0 - m_WrapW: 0 - m_LightmapFormat: 0 - m_ColorSpace: 0 - m_PlatformBlob: - image data: 128 - _typelessdata: 9af967c3f0522742d6c32c430000803f736868c3fb292c42e07a2e430000803ff8136ac380152a42d6632d430000803f21f06ac3420b304270fd2a430000803f4a8c67c361903742f5282b430000803f879664c394c33142d6632e430000803fd90e63c3d2cd314214ee2c430000803f540365c3d24d2742a9d12c430000803f - m_StreamData: - serializedVersion: 2 - offset: 0 - size: 0 - path: --- !u!1001 &1317902692 PrefabInstance: m_ObjectHideFlags: 0 @@ -349120,7 +349120,7 @@ PrefabInstance: type: 3} propertyPath: m_PropertySheet.m_NamedObject.m_Array.Array.data[0].m_Value value: - objectReference: {fileID: 1317541232} + objectReference: {fileID: 1174240676} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 24cf10a9d79cd20439523f1400bc1fce, type: 3} --- !u!4 &854138841937624099 stripped @@ -359787,7 +359787,7 @@ PrefabInstance: - target: {fileID: 2980757906006962752, guid: 364d21a5e4c0c464784d42f01767a083, type: 3} propertyPath: m_AnchoredPosition.x - value: 23.999603 + value: 23.999664 objectReference: {fileID: 0} - target: {fileID: 3143658858329877772, guid: 364d21a5e4c0c464784d42f01767a083, type: 3} diff --git a/Assets/KoboldKare/Scenes/TerrainBrushVolumeTerrainMatMainMap.mat b/Assets/KoboldKare/Scenes/TerrainBrushVolumeTerrainMatMainMap.mat index aa4c4eabd..8f19634c3 100644 --- a/Assets/KoboldKare/Scenes/TerrainBrushVolumeTerrainMatMainMap.mat +++ b/Assets/KoboldKare/Scenes/TerrainBrushVolumeTerrainMatMainMap.mat @@ -10,8 +10,7 @@ Material: m_Name: TerrainBrushVolumeTerrainMatMainMap m_Shader: {fileID: 4800000, guid: 26b46a3fa6c15d04c9ccdc878b96c6a5, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Shaders/Bark URP.shader b/Assets/KoboldKare/Shaders/Bark URP.shader index e7a9a4562..48d1dfcec 100644 --- a/Assets/KoboldKare/Shaders/Bark URP.shader +++ b/Assets/KoboldKare/Shaders/Bark URP.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Mtree/SRP/Bark URP" { @@ -54,7 +54,7 @@ Shader "Mtree/SRP/Bark URP" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -178,30 +178,30 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -785,13 +785,13 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW +#pragma multi_compile __ _CASTING_PUNCTUAL_LIGHT_SHADOW #define SHADERPASS SHADERPASS_SHADOWCASTER @@ -1111,7 +1111,7 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1407,13 +1407,13 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1734,7 +1734,7 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -2063,522 +2063,6 @@ Shader "Mtree/SRP/Bark URP" } - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MainTex_ST; - float4 _Color; - float4 _BumpMap_ST; - int _CullMode; - float _GlobalWindInfluence; - half _BumpScale; - float _Metallic; - float _Glossiness; - half _OcclusionStrength; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - sampler2D _MainTex; - sampler2D _BumpMap; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g23 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g23 = VAR_VertexPosition21_g23; - float VAR_WindStrength43_g23 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g23 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g23 = (float2(transform37_g23.x , transform37_g23.z)); - float dotResult2_g24 = dot( appendResult38_g23 , float2( 12.9898,78.233 ) ); - float lerpResult8_g24 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g24 ) * 43758.55 ) )); - float VAR_RandomTime16_g23 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g24 ); - float FUNC_Turbulence36_g23 = ( sin( ( ( VAR_RandomTime16_g23 * 40.0 ) - ( VAR_VertexPosition21_g23.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g23 = _WindPulse; - float FUNC_Angle73_g23 = ( VAR_WindStrength43_g23 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g23 * 2.0 ) + FUNC_Turbulence36_g23 ) - ( VAR_VertexPosition21_g23.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g23 ); - float VAR_SinA80_g23 = sin( FUNC_Angle73_g23 ); - float VAR_CosA78_g23 = cos( FUNC_Angle73_g23 ); - float _WindDirection164_g23 = _WindDirection; - float2 localDirectionalEquation164_g23 = DirectionalEquation( _WindDirection164_g23 ); - float2 break165_g23 = localDirectionalEquation164_g23; - float VAR_xLerp83_g23 = break165_g23.x; - float lerpResult118_g23 = lerp( break109_g23.x , ( ( break109_g23.y * VAR_SinA80_g23 ) + ( break109_g23.x * VAR_CosA78_g23 ) ) , VAR_xLerp83_g23); - float3 break98_g23 = VAR_VertexPosition21_g23; - float3 break105_g23 = VAR_VertexPosition21_g23; - float VAR_zLerp95_g23 = break165_g23.y; - float lerpResult120_g23 = lerp( break105_g23.z , ( ( break105_g23.y * VAR_SinA80_g23 ) + ( break105_g23.z * VAR_CosA78_g23 ) ) , VAR_zLerp95_g23); - float3 appendResult122_g23 = (float3(lerpResult118_g23 , ( ( break98_g23.y * VAR_CosA78_g23 ) - ( break98_g23.z * VAR_SinA80_g23 ) ) , lerpResult120_g23)); - float3 FUNC_vertexPos123_g23 = appendResult122_g23; - float3 temp_output_5_0_g23 = mul( GetWorldToObjectMatrix(), float4( FUNC_vertexPos123_g23 , 0.0 ) ).xyz; - float3 OUT_VertexPos212 = temp_output_5_0_g23; - - o.ase_texcoord8.xy = v.texcoord.xy; - o.ase_color = v.ase_color; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = OUT_VertexPos212; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_MainTex = IN.ase_texcoord8.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 VAR_AlbedoTexture132 = tex2D( _MainTex, uv_MainTex ); - float4 OUT_Albedo215 = ( VAR_AlbedoTexture132 * _Color ); - - float2 uv_BumpMap = IN.ase_texcoord8.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float3 unpack72 = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), _BumpScale ); - unpack72.z = lerp( 1, unpack72.z, saturate(_BumpScale) ); - float3 OUT_Normal210 = unpack72; - - float lerpResult231 = lerp( 0.0 , VAR_AlbedoTexture132.r , _Glossiness); - float OUT_Smoothness105 = lerpResult231; - - float lerpResult40 = lerp( 1.0 , IN.ase_color.a , _OcclusionStrength); - float OUT_AO204 = lerpResult40; - - float3 Albedo = OUT_Albedo215.rgb; - float3 Normal = OUT_Normal210; - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = OUT_Smoothness105; - float Occlusion = OUT_AO204; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - Pass { @@ -2594,10 +2078,10 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2848,10 +2332,10 @@ Shader "Mtree/SRP/Bark URP" #define ASE_FOG 1 #define ASE_ABSOLUTE_VERTEX_POS 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3100,8 +2584,7 @@ Shader "Mtree/SRP/Bark URP" } /*ASEBEGIN -Version=18935 -182;353;1800;736;256.0663;1111.797;1.63548;True;False +Version=19105 Node;AmplifyShaderEditor.CommentaryNode;213;-1903.765,1192.846;Inherit;False;533.4861;173.9739;;2;212;236;Vertex Pos;0,1,0.09019608,1;0;0 Node;AmplifyShaderEditor.FunctionNode;236;-1860.765,1249.163;Inherit;False;Mtree Wind;8;;23;2ffbceb0d88c2164eb1d1c7b2010084d;7,269,1,281,0,272,0,255,0,278,0,280,0,282,0;0;1;FLOAT3;0 Node;AmplifyShaderEditor.CommentaryNode;62;-1910.43,-1397.629;Inherit;False;1250.078;448.4487;;6;215;94;75;132;79;80;Albedo;1,0.125,0.125,1;0;0 @@ -3138,16 +2621,16 @@ Node;AmplifyShaderEditor.GetLocalVarNode;237;907.5122,-315.1853;Inherit;False;20 Node;AmplifyShaderEditor.LerpOp;231;-1308.27,303.9565;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;210;-830.3501,-348.4981;Inherit;False;OUT_Normal;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.GetLocalVarNode;216;889.3597,-624.7513;Inherit;False;215;OUT_Albedo;1;0;OBJECT;;False;1;COLOR;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;258;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;256;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;259;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;257;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;255;1462.745,-600.17;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;Mtree/SRP/Bark URP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;2;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951707409075192;LOD CrossFade;0;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;False;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;261;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;2;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;254;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;262;1462.745,-520.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;260;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;263;1462.745,-520.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;258;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;256;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;259;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;257;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;255;1462.745,-600.17;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Mtree/SRP/Bark URP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;True;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951707409075192;LOD CrossFade;0;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;False;True;False;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;261;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;254;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;262;1462.745,-520.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;260;1462.745,-600.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;263;1462.745,-520.17;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;212;0;236;0 WireConnection;77;0;86;0 WireConnection;40;1;39;4 @@ -3172,4 +2655,4 @@ WireConnection;255;4;108;0 WireConnection;255;5;237;0 WireConnection;255;8;214;0 ASEEND*/ -//CHKSM=183CA07B4E512209BAE1DA4602E60985A0CF0B88 \ No newline at end of file +//CHKSM=A9F03C003DFE123493007FD7EE81459FE6F25160 diff --git a/Assets/KoboldKare/Shaders/Bouncy.shader b/Assets/KoboldKare/Shaders/Bouncy.shader index 0c6341c89..88b3f82e1 100644 --- a/Assets/KoboldKare/Shaders/Bouncy.shader +++ b/Assets/KoboldKare/Shaders/Bouncy.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Naelstrof/Bouncy" { @@ -52,7 +52,7 @@ Shader "Naelstrof/Bouncy" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -175,30 +175,30 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -734,13 +734,13 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW +#pragma multi_compile __ _CASTING_PUNCTUAL_LIGHT_SHADOW #define SHADERPASS SHADERPASS_SHADOWCASTER @@ -1021,7 +1021,7 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1278,13 +1278,13 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1547,259 +1547,6 @@ Shader "Naelstrof/Bouncy" } - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseColorMap_ST; - float4 _NormalMap_ST; - float4 _MaskMap_ST; - float3 _BounceAxis; - float3 _BounceSideAxis; - float _BounceOffset; - float _BounceAmount; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BaseColorMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float mulTime34 = _TimeParameters.x * 3.0; - float dotResult14 = dot( _BounceAxis , v.vertex.xyz ); - float temp_output_33_0 = ( ( dotResult14 + _BounceOffset ) * 0.5 ); - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = ( ( ( _BounceAxis * abs( sin( mulTime34 ) ) * temp_output_33_0 ) + ( _BounceSideAxis * sin( mulTime34 ) * temp_output_33_0 ) ) * _BounceAmount ); - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BaseColorMap = IN.ase_texcoord2.xy * _BaseColorMap_ST.xy + _BaseColorMap_ST.zw; - - - float3 Albedo = tex2D( _BaseColorMap, uv_BaseColorMap ).rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -1817,7 +1564,7 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -2102,474 +1849,6 @@ Shader "Naelstrof/Bouncy" } - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseColorMap_ST; - float4 _NormalMap_ST; - float4 _MaskMap_ST; - float3 _BounceAxis; - float3 _BounceSideAxis; - float _BounceOffset; - float _BounceAmount; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BaseColorMap; - sampler2D _NormalMap; - sampler2D _MaskMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float mulTime34 = _TimeParameters.x * 3.0; - float dotResult14 = dot( _BounceAxis , v.vertex.xyz ); - float temp_output_33_0 = ( ( dotResult14 + _BounceOffset ) * 0.5 ); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = ( ( ( _BounceAxis * abs( sin( mulTime34 ) ) * temp_output_33_0 ) + ( _BounceSideAxis * sin( mulTime34 ) * temp_output_33_0 ) ) * _BounceAmount ); - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_BaseColorMap = IN.ase_texcoord8.xy * _BaseColorMap_ST.xy + _BaseColorMap_ST.zw; - - float2 uv_NormalMap = IN.ase_texcoord8.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - - float2 uv_MaskMap = IN.ase_texcoord8.xy * _MaskMap_ST.xy + _MaskMap_ST.zw; - float4 tex2DNode22 = tex2D( _MaskMap, uv_MaskMap ); - - float3 Albedo = tex2D( _BaseColorMap, uv_BaseColorMap ).rgb; - float3 Normal = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = tex2DNode22.r; - float Smoothness = tex2DNode22.a; - float Occlusion = tex2DNode22.g; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - Pass { @@ -2584,10 +1863,10 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2799,10 +2078,10 @@ Shader "Naelstrof/Bouncy" #pragma multi_compile_fog #define ASE_FOG 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3013,8 +2292,7 @@ Shader "Naelstrof/Bouncy" } /*ASEBEGIN -Version=18935 -182;353;1800;736;1450.74;77.8586;1.5243;True;False +Version=19105 Node;AmplifyShaderEditor.PosVertexDataNode;12;-1620.331,409.3525;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.Vector3Node;13;-1503.876,215.5733;Inherit;False;Property;_BounceAxis;BounceAxis;0;0;Create;True;0;0;0;False;0;False;0,0,1;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.RangedFloatNode;24;-1725.439,118.2679;Inherit;False;Property;_BounceOffset;BounceOffset;5;0;Create;True;0;0;0;False;0;False;0.25;0.25;-1;1;0;1;FLOAT;0 @@ -3034,16 +2312,16 @@ Node;AmplifyShaderEditor.SimpleMultiplyOpNode;39;-49.68642,429.6441;Inherit;Fals Node;AmplifyShaderEditor.SamplerNode;22;-539.0828,35.3051;Inherit;True;Property;_MaskMap;MaskMap;4;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;20;-881.0198,-584.1724;Inherit;True;Property;_BaseColorMap;BaseColorMap;2;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;21;-889.9739,-360.3155;Inherit;True;Property;_NormalMap;NormalMap;3;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;52;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;56;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;55;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;54;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;53;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;49;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;51;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;50;162.6811,18.28588;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;Naelstrof/Bouncy;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951711113256927;LOD CrossFade;0;637951711106488662;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;637951711224326527;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;57;162.6811,98.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;58;162.6811,98.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;52;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;56;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;55;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;54;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;53;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;49;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;51;162.6811,18.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;50;162.6811,18.28588;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Naelstrof/Bouncy;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951711113256927;LOD CrossFade;0;637951711106488662;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;637951711224326527;0;10;False;True;True;True;True;False;True;False;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;57;162.6811,98.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;58;162.6811,98.28588;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;14;0;13;0 WireConnection;14;1;12;0 WireConnection;15;0;14;0 @@ -3069,4 +2347,4 @@ WireConnection;50;4;22;4 WireConnection;50;5;22;2 WireConnection;50;8;39;0 ASEEND*/ -//CHKSM=4432DCD7957BC4CFD41D5C371FCFA393C8D1ECF0 \ No newline at end of file +//CHKSM=8CC1B2B36DCE7E04822A6579F382D813F7A0CA7F diff --git a/Assets/KoboldKare/Shaders/CumStream.shader b/Assets/KoboldKare/Shaders/CumStream.shader index 924b9278e..cabcf2df9 100644 --- a/Assets/KoboldKare/Shaders/CumStream.shader +++ b/Assets/KoboldKare/Shaders/CumStream.shader @@ -174,27 +174,27 @@ Shader "CumStream" #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -757,7 +757,7 @@ Shader "CumStream" #pragma vertex vert #pragma fragment frag - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW +#pragma multi_compile __ _CASTING_PUNCTUAL_LIGHT_SHADOW #define SHADERPASS SHADERPASS_SHADOWCASTER @@ -1905,21 +1905,21 @@ Shader "CumStream" #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED +#pragma multi_compile __ _SHADOWS_SOFT +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _GBUFFER_NORMALS_OCT +#pragma multi_compile __ _LIGHT_LAYERS +#pragma multi_compile __ _RENDER_PASS_ENABLED #pragma vertex vert #pragma fragment frag @@ -2889,4 +2889,4 @@ WireConnection;10;1;11;0 WireConnection;10;2;28;0 WireConnection;10;3;29;0 ASEEND*/ -//CHKSM=057E23E04EB8E24EE8A17A55D86D57D114BF9B75 \ No newline at end of file +//CHKSM=057E23E04EB8E24EE8A17A55D86D57D114BF9B75 diff --git a/Assets/KoboldKare/Shaders/Dick.shader b/Assets/KoboldKare/Shaders/Dick.shader index 51f2a5a61..39ae591f7 100644 --- a/Assets/KoboldKare/Shaders/Dick.shader +++ b/Assets/KoboldKare/Shaders/Dick.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Custom/Dick" { @@ -59,7 +59,7 @@ Shader "Custom/Dick" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -184,7 +184,7 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION @@ -325,7 +325,7 @@ Shader "Custom/Dick" return basisTransform; } - float4 MyCustomExpression1_g724( float4 hsbc, float4 startColor ) + float4 MyCustomExpression1_g726( float4 hsbc, float4 startColor ) { float _Hue = 360 * hsbc.r; float _Brightness = hsbc.g * 2 - 1; @@ -611,13 +611,13 @@ Shader "Custom/Dick" WorldViewDirection = SafeNormalize( WorldViewDirection ); - float4 hsbc1_g724 = _HueBrightnessContrastSaturation; + float4 hsbc1_g726 = _HueBrightnessContrastSaturation; float2 uv_MainTex = IN.ase_texcoord8.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 startColor1_g724 = tex2D( _MainTex, uv_MainTex ); - float4 localMyCustomExpression1_g724 = MyCustomExpression1_g724( hsbc1_g724 , startColor1_g724 ); + float4 startColor1_g726 = tex2D( _MainTex, uv_MainTex ); + float4 localMyCustomExpression1_g726 = MyCustomExpression1_g726( hsbc1_g726 , startColor1_g726 ); float2 texCoord103 = IN.ase_texcoord8.zw * float2( 1,1 ) + float2( 0,0 ); float4 tex2DNode104 = tex2Dlod( _DecalColorMap, float4( texCoord103, 0, 0.0) ); - float4 lerpResult105 = lerp( localMyCustomExpression1_g724 , tex2DNode104 , tex2DNode104.a); + float4 lerpResult105 = lerp( localMyCustomExpression1_g726 , tex2DNode104 , tex2DNode104.a); float2 uv_BumpMap = IN.ase_texcoord8.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; @@ -860,7 +860,7 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1231,7 +1231,7 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1572,13 +1572,13 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION + #pragma shader_feature_local _ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1681,7 +1681,7 @@ Shader "Custom/Dick" return basisTransform; } - float4 MyCustomExpression1_g724( float4 hsbc, float4 startColor ) + float4 MyCustomExpression1_g726( float4 hsbc, float4 startColor ) { float _Hue = 360 * hsbc.r; float _Brightness = hsbc.g * 2 - 1; @@ -1911,13 +1911,13 @@ Shader "Custom/Dick" #endif #endif - float4 hsbc1_g724 = _HueBrightnessContrastSaturation; + float4 hsbc1_g726 = _HueBrightnessContrastSaturation; float2 uv_MainTex = IN.ase_texcoord4.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 startColor1_g724 = tex2D( _MainTex, uv_MainTex ); - float4 localMyCustomExpression1_g724 = MyCustomExpression1_g724( hsbc1_g724 , startColor1_g724 ); + float4 startColor1_g726 = tex2D( _MainTex, uv_MainTex ); + float4 localMyCustomExpression1_g726 = MyCustomExpression1_g726( hsbc1_g726 , startColor1_g726 ); float2 texCoord103 = IN.ase_texcoord4.zw * float2( 1,1 ) + float2( 0,0 ); float4 tex2DNode104 = tex2Dlod( _DecalColorMap, float4( texCoord103, 0, 0.0) ); - float4 lerpResult105 = lerp( localMyCustomExpression1_g724 , tex2DNode104 , tex2DNode104.a); + float4 lerpResult105 = lerp( localMyCustomExpression1_g726 , tex2DNode104 , tex2DNode104.a); float4 appendResult67_g722 = (float4(IN.ase_texcoord5.xyz , 1.0)); float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); @@ -1953,11 +1953,13 @@ Shader "Custom/Dick" Pass { - Name "Universal2D" - Tags { "LightMode"="Universal2D" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Blend One Zero, One Zero - ColorMask RGBA + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM @@ -1967,24 +1969,22 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_VERT_NORMAL + #define ASE_NEEDS_VERT_TANGENT #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -1995,7 +1995,6 @@ Shader "Custom/Dick" float4 ase_tangent : TANGENT; float4 ase_color : COLOR; float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -2008,8 +2007,10 @@ Shader "Custom/Dick" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + float4 ase_texcoord4 : TEXCOORD4; + float4 ase_texcoord5 : TEXCOORD5; float4 ase_color : COLOR; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO @@ -2049,8 +2050,7 @@ Shader "Custom/Dick" float _TessMaxDisp; #endif CBUFFER_END - sampler2D _MainTex; - sampler2D _DecalColorMap; + sampler2D _BumpMap; float3x3 ChangeOfBasis9_g722( float3 right, float3 up, float3 forward ) @@ -2068,33 +2068,13 @@ Shader "Custom/Dick" return basisTransform; } - float4 MyCustomExpression1_g724( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } - VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); float localToCatmullRomSpace_float56_g722 = ( 0.0 ); float3 worldDickRootPos56_g722 = _DickRootWorld; @@ -2145,11 +2125,12 @@ Shader "Custom/Dick" float3 normalizeResult76_g722 = normalize( (mul( GetWorldToObjectMatrix(), appendResult75_g722 )).xyz ); float3 lerpResult578 = lerp( v.ase_normal , normalizeResult76_g722 , v.ase_color.r); - o.ase_texcoord2.xy = v.ase_texcoord.xy; - o.ase_texcoord2.zw = v.ase_texcoord1.xy; - o.ase_texcoord3 = v.vertex; + o.ase_texcoord4.xy = v.ase_texcoord.xy; + o.ase_texcoord5 = v.vertex; o.ase_color = v.ase_color; + //setting value to unused interpolator channels and avoid initialization warnings + o.ase_texcoord4.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else @@ -2163,21 +2144,26 @@ Shader "Custom/Dick" #endif v.ase_normal = lerpResult578; - + v.ase_tangent = v.ase_tangent; + float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); float4 positionCS = TransformWorldToHClip( positionWS ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; o.shadowCoord = GetShadowCoord( vertexInput ); #endif - o.clipPos = positionCS; return o; } @@ -2190,7 +2176,6 @@ Shader "Custom/Dick" float4 ase_tangent : TANGENT; float4 ase_color : COLOR; float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -2211,7 +2196,6 @@ Shader "Custom/Dick" o.ase_tangent = v.ase_tangent; o.ase_color = v.ase_color; o.ase_texcoord = v.ase_texcoord; - o.ase_texcoord1 = v.ase_texcoord1; return o; } @@ -2253,7 +2237,6 @@ Shader "Custom/Dick" o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) @@ -2271,15 +2254,27 @@ Shader "Custom/Dick" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { - UNITY_SETUP_INSTANCE_ID( IN ); + UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -2289,1003 +2284,58 @@ Shader "Custom/Dick" #endif #endif - float4 hsbc1_g724 = _HueBrightnessContrastSaturation; - float2 uv_MainTex = IN.ase_texcoord2.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 startColor1_g724 = tex2D( _MainTex, uv_MainTex ); - float4 localMyCustomExpression1_g724 = MyCustomExpression1_g724( hsbc1_g724 , startColor1_g724 ); - float2 texCoord103 = IN.ase_texcoord2.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode104 = tex2Dlod( _DecalColorMap, float4( texCoord103, 0, 0.0) ); - float4 lerpResult105 = lerp( localMyCustomExpression1_g724 , tex2DNode104 , tex2DNode104.a); + float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float4 appendResult67_g722 = (float4(IN.ase_texcoord3.xyz , 1.0)); + float4 appendResult67_g722 = (float4(IN.ase_texcoord5.xyz , 1.0)); float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); float3 temp_output_68_0_g722 = (transform66_g722).xyz; float dotResult42_g722 = dot( _DickForwardWorld , ( temp_output_68_0_g722 - _DickRootWorld ) ); float temp_output_54_0_g722 = ( 1.0 - ( saturate( ( -( _StartClip - dotResult42_g722 ) * 10.0 ) ) * saturate( ( -( dotResult42_g722 - _EndClip ) * 10.0 ) ) ) ); float lerpResult583 = lerp( 1.0 , temp_output_54_0_g722 , IN.ase_color.r); - - float3 Albedo = lerpResult105.rgb; + float3 Normal = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), 1.0f ); float Alpha = lerpResult583; float AlphaClipThreshold = 0.01; - - half4 color = half4( Albedo, Alpha ); + #ifdef ASE_DEPTH_WRITE_ON + float DepthValue = 0; + #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_VERT_NORMAL - #define ASE_NEEDS_VERT_TANGENT - #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; + + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - float4 ase_texcoord5 : TEXCOORD5; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _HueBrightnessContrastSaturation; - float4 _MainTex_ST; - float4 _BumpMap_ST; - float4 _MaskMap_ST; - float3 _DickRootWorld; - float3 _DickForwardWorld; - float3 _DickRightWorld; - float3 _DickUpWorld; - float _SquashStretchCorrection; - float _DistanceToHole; - float _DickWorldLength; - float _StartClip; - float _EndClip; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BumpMap; - + + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); + #else + + #if defined(_NORMALMAP) + #if _NORMAL_DROPOFF_TS + float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); + float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); + float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); + #elif _NORMAL_DROPOFF_OS + float3 normalWS = TransformObjectToWorldNormal(Normal); + #elif _NORMAL_DROPOFF_WS + float3 normalWS = Normal; + #endif + #else + float3 normalWS = WorldNormal; + #endif - float3x3 ChangeOfBasis9_g722( float3 right, float3 up, float3 forward ) - { - float3x3 basisTransform = 0; - basisTransform[0][0] = right.x; - basisTransform[0][1] = right.y; - basisTransform[0][2] = right.z; - basisTransform[1][0] = up.x; - basisTransform[1][1] = up.y; - basisTransform[1][2] = up.z; - basisTransform[2][0] = forward.x; - basisTransform[2][1] = forward.y; - basisTransform[2][2] = forward.z; - return basisTransform; + return half4(NormalizeNormalPerPixel(normalWS), 0.0); + #endif } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float localToCatmullRomSpace_float56_g722 = ( 0.0 ); - float3 worldDickRootPos56_g722 = _DickRootWorld; - float3 right9_g722 = _DickRightWorld; - float3 up9_g722 = _DickUpWorld; - float3 forward9_g722 = _DickForwardWorld; - float3x3 localChangeOfBasis9_g722 = ChangeOfBasis9_g722( right9_g722 , up9_g722 , forward9_g722 ); - float4 appendResult67_g722 = (float4(v.vertex.xyz , 1.0)); - float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); - float3 temp_output_68_0_g722 = (transform66_g722).xyz; - float3 temp_output_12_0_g722 = mul( localChangeOfBasis9_g722, ( temp_output_68_0_g722 - _DickRootWorld ) ); - float3 break15_g722 = temp_output_12_0_g722; - float temp_output_18_0_g722 = ( break15_g722.z * _SquashStretchCorrection ); - float3 appendResult26_g722 = (float3(break15_g722.x , break15_g722.y , temp_output_18_0_g722)); - float3 appendResult25_g722 = (float3(( break15_g722.x / _SquashStretchCorrection ) , ( break15_g722.y / _SquashStretchCorrection ) , temp_output_18_0_g722)); - float temp_output_17_0_g722 = ( _DistanceToHole * 0.5 ); - float smoothstepResult23_g722 = smoothstep( 0.0 , temp_output_17_0_g722 , temp_output_18_0_g722); - float smoothstepResult22_g722 = smoothstep( _DistanceToHole , temp_output_17_0_g722 , temp_output_18_0_g722); - float3 lerpResult31_g722 = lerp( appendResult26_g722 , appendResult25_g722 , min( smoothstepResult23_g722 , smoothstepResult22_g722 )); - float3 lerpResult32_g722 = lerp( lerpResult31_g722 , ( temp_output_12_0_g722 + ( ( _DistanceToHole - ( _DickWorldLength * ( _DistanceToHole / ( _SquashStretchCorrection * _DickWorldLength ) ) ) ) * float3(0,0,1) ) ) , step( _DistanceToHole , temp_output_18_0_g722 )); - float3 temp_output_37_0_g722 = ( _DickRootWorld + mul( transpose( localChangeOfBasis9_g722 ), lerpResult32_g722 ) ); - float dotResult42_g722 = dot( _DickForwardWorld , ( temp_output_68_0_g722 - _DickRootWorld ) ); - float temp_output_54_0_g722 = ( 1.0 - ( saturate( ( -( _StartClip - dotResult42_g722 ) * 10.0 ) ) * saturate( ( -( dotResult42_g722 - _EndClip ) * 10.0 ) ) ) ); - float3 lerpResult106_g722 = lerp( ( _DickRootWorld + ( _DickForwardWorld * break15_g722.z ) ) , temp_output_37_0_g722 , temp_output_54_0_g722); - float3 worldPosition56_g722 = lerpResult106_g722; - float3 worldDickForward56_g722 = _DickForwardWorld; - float3 worldDickUp56_g722 = _DickUpWorld; - float3 worldDickRight56_g722 = _DickRightWorld; - float4 appendResult86_g722 = (float4(v.ase_normal , 0.0)); - float3 normalizeResult87_g722 = normalize( (mul( GetObjectToWorldMatrix(), appendResult86_g722 )).xyz ); - float3 worldNormal56_g722 = normalizeResult87_g722; - float4 break93_g722 = v.ase_tangent; - float4 appendResult89_g722 = (float4(break93_g722.x , break93_g722.y , break93_g722.z , 0.0)); - float3 normalizeResult91_g722 = normalize( (mul( GetObjectToWorldMatrix(), appendResult89_g722 )).xyz ); - float4 appendResult94_g722 = (float4(normalizeResult91_g722 , break93_g722.w)); - float4 worldTangent56_g722 = appendResult94_g722; - float3 worldPositionOUT56_g722 = float3( 0,0,0 ); - float3 worldNormalOUT56_g722 = float3( 0,0,0 ); - float4 worldTangentOUT56_g722 = float4( 0,0,0,0 ); - { - ToCatmullRomSpace_float(worldDickRootPos56_g722,worldPosition56_g722,worldDickForward56_g722,worldDickUp56_g722,worldDickRight56_g722,worldNormal56_g722,worldTangent56_g722,worldPositionOUT56_g722,worldNormalOUT56_g722,worldTangentOUT56_g722); - } - float4 appendResult73_g722 = (float4(worldPositionOUT56_g722 , 1.0)); - float4 transform72_g722 = mul(GetWorldToObjectMatrix(),appendResult73_g722); - float3 lerpResult575 = lerp( v.vertex.xyz , (transform72_g722).xyz , v.ase_color.r); - - float4 appendResult75_g722 = (float4(worldNormalOUT56_g722 , 0.0)); - float3 normalizeResult76_g722 = normalize( (mul( GetWorldToObjectMatrix(), appendResult75_g722 )).xyz ); - float3 lerpResult578 = lerp( v.ase_normal , normalizeResult76_g722 , v.ase_color.r); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - o.ase_texcoord5 = v.vertex; - o.ase_color = v.ase_color; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = lerpResult575; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = lerpResult578; - v.ase_tangent = v.ase_tangent; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_color = v.ase_color; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - - float4 appendResult67_g722 = (float4(IN.ase_texcoord5.xyz , 1.0)); - float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); - float3 temp_output_68_0_g722 = (transform66_g722).xyz; - float dotResult42_g722 = dot( _DickForwardWorld , ( temp_output_68_0_g722 - _DickRootWorld ) ); - float temp_output_54_0_g722 = ( 1.0 - ( saturate( ( -( _StartClip - dotResult42_g722 ) * 10.0 ) ) * saturate( ( -( dotResult42_g722 - _EndClip ) * 10.0 ) ) ) ); - float lerpResult583 = lerp( 1.0 , temp_output_54_0_g722 , IN.ase_color.r); - - float3 Normal = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), 1.0f ); - float Alpha = lerpResult583; - float AlphaClipThreshold = 0.01; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_VERT_NORMAL - #define ASE_NEEDS_VERT_TANGENT - #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - float4 ase_texcoord9 : TEXCOORD9; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _HueBrightnessContrastSaturation; - float4 _MainTex_ST; - float4 _BumpMap_ST; - float4 _MaskMap_ST; - float3 _DickRootWorld; - float3 _DickForwardWorld; - float3 _DickRightWorld; - float3 _DickUpWorld; - float _SquashStretchCorrection; - float _DistanceToHole; - float _DickWorldLength; - float _StartClip; - float _EndClip; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _MainTex; - sampler2D _DecalColorMap; - sampler2D _BumpMap; - sampler2D _MaskMap; - - - float3x3 ChangeOfBasis9_g722( float3 right, float3 up, float3 forward ) - { - float3x3 basisTransform = 0; - basisTransform[0][0] = right.x; - basisTransform[0][1] = right.y; - basisTransform[0][2] = right.z; - basisTransform[1][0] = up.x; - basisTransform[1][1] = up.y; - basisTransform[1][2] = up.z; - basisTransform[2][0] = forward.x; - basisTransform[2][1] = forward.y; - basisTransform[2][2] = forward.z; - return basisTransform; - } - - float4 MyCustomExpression1_g724( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float localToCatmullRomSpace_float56_g722 = ( 0.0 ); - float3 worldDickRootPos56_g722 = _DickRootWorld; - float3 right9_g722 = _DickRightWorld; - float3 up9_g722 = _DickUpWorld; - float3 forward9_g722 = _DickForwardWorld; - float3x3 localChangeOfBasis9_g722 = ChangeOfBasis9_g722( right9_g722 , up9_g722 , forward9_g722 ); - float4 appendResult67_g722 = (float4(v.vertex.xyz , 1.0)); - float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); - float3 temp_output_68_0_g722 = (transform66_g722).xyz; - float3 temp_output_12_0_g722 = mul( localChangeOfBasis9_g722, ( temp_output_68_0_g722 - _DickRootWorld ) ); - float3 break15_g722 = temp_output_12_0_g722; - float temp_output_18_0_g722 = ( break15_g722.z * _SquashStretchCorrection ); - float3 appendResult26_g722 = (float3(break15_g722.x , break15_g722.y , temp_output_18_0_g722)); - float3 appendResult25_g722 = (float3(( break15_g722.x / _SquashStretchCorrection ) , ( break15_g722.y / _SquashStretchCorrection ) , temp_output_18_0_g722)); - float temp_output_17_0_g722 = ( _DistanceToHole * 0.5 ); - float smoothstepResult23_g722 = smoothstep( 0.0 , temp_output_17_0_g722 , temp_output_18_0_g722); - float smoothstepResult22_g722 = smoothstep( _DistanceToHole , temp_output_17_0_g722 , temp_output_18_0_g722); - float3 lerpResult31_g722 = lerp( appendResult26_g722 , appendResult25_g722 , min( smoothstepResult23_g722 , smoothstepResult22_g722 )); - float3 lerpResult32_g722 = lerp( lerpResult31_g722 , ( temp_output_12_0_g722 + ( ( _DistanceToHole - ( _DickWorldLength * ( _DistanceToHole / ( _SquashStretchCorrection * _DickWorldLength ) ) ) ) * float3(0,0,1) ) ) , step( _DistanceToHole , temp_output_18_0_g722 )); - float3 temp_output_37_0_g722 = ( _DickRootWorld + mul( transpose( localChangeOfBasis9_g722 ), lerpResult32_g722 ) ); - float dotResult42_g722 = dot( _DickForwardWorld , ( temp_output_68_0_g722 - _DickRootWorld ) ); - float temp_output_54_0_g722 = ( 1.0 - ( saturate( ( -( _StartClip - dotResult42_g722 ) * 10.0 ) ) * saturate( ( -( dotResult42_g722 - _EndClip ) * 10.0 ) ) ) ); - float3 lerpResult106_g722 = lerp( ( _DickRootWorld + ( _DickForwardWorld * break15_g722.z ) ) , temp_output_37_0_g722 , temp_output_54_0_g722); - float3 worldPosition56_g722 = lerpResult106_g722; - float3 worldDickForward56_g722 = _DickForwardWorld; - float3 worldDickUp56_g722 = _DickUpWorld; - float3 worldDickRight56_g722 = _DickRightWorld; - float4 appendResult86_g722 = (float4(v.ase_normal , 0.0)); - float3 normalizeResult87_g722 = normalize( (mul( GetObjectToWorldMatrix(), appendResult86_g722 )).xyz ); - float3 worldNormal56_g722 = normalizeResult87_g722; - float4 break93_g722 = v.ase_tangent; - float4 appendResult89_g722 = (float4(break93_g722.x , break93_g722.y , break93_g722.z , 0.0)); - float3 normalizeResult91_g722 = normalize( (mul( GetObjectToWorldMatrix(), appendResult89_g722 )).xyz ); - float4 appendResult94_g722 = (float4(normalizeResult91_g722 , break93_g722.w)); - float4 worldTangent56_g722 = appendResult94_g722; - float3 worldPositionOUT56_g722 = float3( 0,0,0 ); - float3 worldNormalOUT56_g722 = float3( 0,0,0 ); - float4 worldTangentOUT56_g722 = float4( 0,0,0,0 ); - { - ToCatmullRomSpace_float(worldDickRootPos56_g722,worldPosition56_g722,worldDickForward56_g722,worldDickUp56_g722,worldDickRight56_g722,worldNormal56_g722,worldTangent56_g722,worldPositionOUT56_g722,worldNormalOUT56_g722,worldTangentOUT56_g722); - } - float4 appendResult73_g722 = (float4(worldPositionOUT56_g722 , 1.0)); - float4 transform72_g722 = mul(GetWorldToObjectMatrix(),appendResult73_g722); - float3 lerpResult575 = lerp( v.vertex.xyz , (transform72_g722).xyz , v.ase_color.r); - - float4 appendResult75_g722 = (float4(worldNormalOUT56_g722 , 0.0)); - float3 normalizeResult76_g722 = normalize( (mul( GetWorldToObjectMatrix(), appendResult75_g722 )).xyz ); - float3 lerpResult578 = lerp( v.ase_normal , normalizeResult76_g722 , v.ase_color.r); - - o.ase_texcoord8.xy = v.texcoord.xy; - o.ase_texcoord8.zw = v.texcoord1.xy; - o.ase_texcoord9 = v.vertex; - o.ase_color = v.ase_color; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = lerpResult575; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = lerpResult578; - v.ase_tangent = v.ase_tangent; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float4 hsbc1_g724 = _HueBrightnessContrastSaturation; - float2 uv_MainTex = IN.ase_texcoord8.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 startColor1_g724 = tex2D( _MainTex, uv_MainTex ); - float4 localMyCustomExpression1_g724 = MyCustomExpression1_g724( hsbc1_g724 , startColor1_g724 ); - float2 texCoord103 = IN.ase_texcoord8.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode104 = tex2Dlod( _DecalColorMap, float4( texCoord103, 0, 0.0) ); - float4 lerpResult105 = lerp( localMyCustomExpression1_g724 , tex2DNode104 , tex2DNode104.a); - - float2 uv_BumpMap = IN.ase_texcoord8.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - - float2 uv_MaskMap = IN.ase_texcoord8.xy * _MaskMap_ST.xy + _MaskMap_ST.zw; - float4 tex2DNode102 = tex2D( _MaskMap, uv_MaskMap ); - - float lerpResult108 = lerp( tex2DNode102.a , 0.9 , tex2DNode104.a); - - float4 appendResult67_g722 = (float4(IN.ase_texcoord9.xyz , 1.0)); - float4 transform66_g722 = mul(GetObjectToWorldMatrix(),appendResult67_g722); - float3 temp_output_68_0_g722 = (transform66_g722).xyz; - float dotResult42_g722 = dot( _DickForwardWorld , ( temp_output_68_0_g722 - _DickRootWorld ) ); - float temp_output_54_0_g722 = ( 1.0 - ( saturate( ( -( _StartClip - dotResult42_g722 ) * 10.0 ) ) * saturate( ( -( dotResult42_g722 - _EndClip ) * 10.0 ) ) ) ); - float lerpResult583 = lerp( 1.0 , temp_output_54_0_g722 , IN.ase_color.r); - - float3 Albedo = lerpResult105.rgb; - float3 Normal = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), 1.0f ); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = tex2DNode102.r; - float Smoothness = lerpResult108; - float Occlusion = 1; - float Alpha = lerpResult583; - float AlphaClipThreshold = 0.01; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - ENDHLSL } @@ -3306,10 +2356,10 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3605,10 +2655,10 @@ Shader "Custom/Dick" #define ASE_ABSOLUTE_VERTEX_POS 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3901,8 +2951,7 @@ Shader "Custom/Dick" } /*ASEBEGIN -Version=18935 -321;384;1528;718;-5335.359;1290.071;1.824678;True;False +Version=19105 Node;AmplifyShaderEditor.CommentaryNode;206;6016.412,-2050.383;Inherit;False;1888.192;1147.05;FragmentShader;11;106;103;100;104;107;101;102;108;105;445;553;;1,1,1,1;0;0 Node;AmplifyShaderEditor.NormalVertexDataNode;579;6421.92,-768.8914;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.FunctionNode;574;6326.138,-217.7695;Inherit;False;PenetratorDeformationShrink;1;;722;ad4a380768980ef49a79fe23c545abef;0;3;64;FLOAT3;0,0,0;False;69;FLOAT3;0,0,0;False;71;FLOAT4;0,0,0,0;False;4;FLOAT3;61;FLOAT3;62;FLOAT4;63;FLOAT;0 @@ -3918,22 +2967,22 @@ Node;AmplifyShaderEditor.LerpOp;583;6985.66,-429.6824;Inherit;False;3;0;FLOAT;1; Node;AmplifyShaderEditor.TangentVertexDataNode;582;6421.854,-466.7342;Inherit;False;1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.LerpOp;108;7117.321,-1484.313;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0.9;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;104;6584.06,-2000.383;Inherit;True;Property;_DecalColorMap;DecalColorMap;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;black;Auto;False;Object;-1;MipLevel;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.FunctionNode;107;6529.273,-1778.095;Inherit;False;HueShift;-1;;724;1952e423258605d4aaa526c67ba2eb7c;0;2;2;FLOAT4;0,0.5,0.5,0.5;False;3;COLOR;0,0,0,0;False;1;FLOAT4;0 +Node;AmplifyShaderEditor.FunctionNode;107;6529.273,-1778.095;Inherit;False;HueShift;-1;;726;1952e423258605d4aaa526c67ba2eb7c;0;2;2;FLOAT4;0,0.5,0.5,0.5;False;3;COLOR;0,0,0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SamplerNode;101;6066.412,-1349.593;Inherit;True;Property;_BumpMap;BumpMap;23;0;Create;True;0;0;0;False;0;False;-1;None;9c44ea8cd9bad9a41b2e1c4b503546e2;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.Vector4Node;106;6133.625,-1815.368;Inherit;False;Property;_HueBrightnessContrastSaturation;_HueBrightnessContrastSaturation;24;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0.5019608,0.5019608,0.5019608;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;100;6070.291,-1564.565;Inherit;True;Property;_MainTex;MainTex;21;0;Create;True;0;0;0;False;0;False;-1;None;c6a51a68e5768654f8e614a5d167aefd;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;102;6070.819,-1133.333;Inherit;True;Property;_MaskMap;MaskMap;22;0;Create;True;0;0;0;False;0;False;-1;None;aef0d52182fe29d48985b053faf59e23;True;0;False;gray;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.LerpOp;105;7151.767,-1775.192;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;569;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;GBuffer;0;7;GBuffer;1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;562;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;565;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;563;7623.605,-1459.329;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;Custom/Dick;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Forward;0;1;Forward;20;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951711729303007;LOD CrossFade;0;637951711720212949;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;637937904191780019;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;566;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;568;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;DepthNormals;0;6;DepthNormals;1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;571;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;570;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;567;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;564;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;569;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;GBuffer;0;7;GBuffer;1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;562;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;565;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;563;7623.605,-1459.329;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;14;Custom/Dick;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Forward;0;1;Forward;20;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637951711729303007;LOD CrossFade;0;637951711720212949;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;637937904191780019;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;False;True;False;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;566;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;568;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;DepthNormals;0;6;DepthNormals;1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;571;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;570;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;567;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;564;7623.605,-1459.329;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;17;New Amplify Shader;5b1861a142b3d4e45ba1bb5742a4fa5f;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;575;0;577;0 WireConnection;575;1;574;61 WireConnection;575;2;576;1 @@ -3963,4 +3012,4 @@ WireConnection;563;8;575;0 WireConnection;563;10;578;0 WireConnection;563;20;581;0 ASEEND*/ -//CHKSM=48D1C9BAA9E2F2864274D6FE9604F86DC1579DF9 \ No newline at end of file +//CHKSM=D3C95BE5E7C5B9FB8957A72AC330C0404B600D3A diff --git a/Assets/KoboldKare/Shaders/Foliage.shader b/Assets/KoboldKare/Shaders/Foliage.shader index 098abcfd0..d8fef169c 100644 --- a/Assets/KoboldKare/Shaders/Foliage.shader +++ b/Assets/KoboldKare/Shaders/Foliage.shader @@ -172,30 +172,30 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +#pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -722,7 +722,7 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -979,13 +979,13 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1239,252 +1239,6 @@ Shader "KoboldKare/Foliage" } - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_WS 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseColorMap_ST; - float _AlphaClip; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BaseColorMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BaseColorMap = IN.ase_texcoord2.xy * _BaseColorMap_ST.xy + _BaseColorMap_ST.zw; - float4 tex2DNode8 = tex2D( _BaseColorMap, uv_BaseColorMap ); - - - float3 Albedo = tex2DNode8.rgb; - float Alpha = tex2DNode8.a; - float AlphaClipThreshold = _AlphaClip; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -1504,7 +1258,7 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1790,466 +1544,6 @@ Shader "KoboldKare/Foliage" } - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_WS 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - float4 ase_texcoord9 : TEXCOORD9; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseColorMap_ST; - float _AlphaClip; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BaseColorMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - o.ase_texcoord9.xyz = v.texcoord2.xyz; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - o.ase_texcoord9.w = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_BaseColorMap = IN.ase_texcoord8.xy * _BaseColorMap_ST.xy + _BaseColorMap_ST.zw; - float4 tex2DNode8 = tex2D( _BaseColorMap, uv_BaseColorMap ); - - float3 texCoord44 = IN.ase_texcoord9.xyz; - texCoord44.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 ); - - float3 Albedo = tex2DNode8.rgb; - float3 Normal = texCoord44; - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = 0.0; - float Smoothness = 0.0; - float Occlusion = 1; - float Alpha = tex2DNode8.a; - float AlphaClipThreshold = _AlphaClip; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - Pass { @@ -2266,7 +1560,7 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma only_renderers d3d11 glcore gles gles3 ps5 @@ -2481,7 +1775,7 @@ Shader "KoboldKare/Foliage" #define ASE_FOG 1 #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma only_renderers d3d11 glcore gles gles3 ps5 @@ -2702,7 +1996,7 @@ Node;AmplifyShaderEditor.RangedFloatNode;45;108.2825,226.4891;Inherit;False;Cons Node;AmplifyShaderEditor.SurfaceDepthNode;47;-210.8384,303.7142;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;0,-107.2;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;264,-107.2;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;KoboldKare/Foliage;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;637937897309327907; Refraction Model;0;0; Blend;0;0;Two Sided;0;0;Fragment Normal Space,InvertActionOnDeselection;2;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;637937889870748562; Use Shadow Threshold;1;637937888628278175;Receive Shadows;1;637937889960786162;GPU Instancing;0;638122962501313724;LOD CrossFade;0;638122962507966773;Built-in Fog;1;637937890049269075;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;637937891642674195; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;True;True;True;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;264,-107.2;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;KoboldKare/Foliage;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;637937897309327907; Refraction Model;0;0; Blend;0;0;Two Sided;0;0;Fragment Normal Space,InvertActionOnDeselection;2;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;637937889870748562; Use Shadow Threshold;1;637937888628278175;Receive Shadows;1;637937889960786162;GPU Instancing;0;638122962501313724;LOD CrossFade;0;638122962507966773;Built-in Fog;1;637937890049269075;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;637937891642674195; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;False;True;False;True;True;False;;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;5;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 @@ -2717,4 +2011,4 @@ WireConnection;1;4;21;0 WireConnection;1;6;8;4 WireConnection;1;7;13;0 ASEEND*/ -//CHKSM=4675595288C2FB003899E861CBFCF6B3FD1D5852 \ No newline at end of file +//CHKSM=B10B6C00E9B765DEBAD266D60EA3BAA77E3B802E diff --git a/Assets/KoboldKare/Shaders/FuseDissolver.shader b/Assets/KoboldKare/Shaders/FuseDissolver.shader index a0a831ce5..568a785b3 100644 --- a/Assets/KoboldKare/Shaders/FuseDissolver.shader +++ b/Assets/KoboldKare/Shaders/FuseDissolver.shader @@ -177,30 +177,30 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -791,13 +791,13 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW +#pragma multi_compile __ _CASTING_PUNCTUAL_LIGHT_SHADOW #define SHADERPASS SHADERPASS_SHADOWCASTER @@ -1136,7 +1136,7 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1451,13 +1451,13 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1776,11 +1776,13 @@ Shader "FuseDissolver" Pass { - Name "Universal2D" - Tags { "LightMode"="Universal2D" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Blend One Zero, One Zero - ColorMask RGBA + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM @@ -1790,22 +1792,19 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + #define ASE_NEEDS_FRAG_POSITION @@ -1813,6 +1812,7 @@ Shader "FuseDissolver" { float4 vertex : POSITION; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -1826,8 +1826,10 @@ Shader "FuseDissolver" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + float4 ase_texcoord4 : TEXCOORD4; + float4 ase_texcoord5 : TEXCOORD5; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -1860,6 +1862,7 @@ Shader "FuseDissolver" float _TessMaxDisp; #endif CBUFFER_END + sampler2D _NormalMap; sampler2D _BaseMap; @@ -1914,16 +1917,15 @@ Shader "FuseDissolver" VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - o.ase_texcoord2.xy = v.ase_texcoord.xy; - o.ase_texcoord3 = v.vertex; + o.ase_texcoord4.xy = v.ase_texcoord.xy; + o.ase_texcoord5 = v.vertex; //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - + o.ase_texcoord4.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else @@ -1937,21 +1939,24 @@ Shader "FuseDissolver" #endif v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); float4 positionCS = TransformWorldToHClip( positionWS ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; o.shadowCoord = GetShadowCoord( vertexInput ); #endif - o.clipPos = positionCS; return o; } @@ -1961,6 +1966,7 @@ Shader "FuseDissolver" { float4 vertex : INTERNALTESSPOS; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID @@ -1979,6 +1985,7 @@ Shader "FuseDissolver" UNITY_TRANSFER_INSTANCE_ID(v, o); o.vertex = v.vertex; o.ase_normal = v.ase_normal; + o.ase_tangent = v.ase_tangent; o.ase_texcoord = v.ase_texcoord; return o; } @@ -2018,6 +2025,7 @@ Shader "FuseDissolver" VertexInput o = (VertexInput) 0; o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; + o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; @@ -2036,15 +2044,27 @@ Shader "FuseDissolver" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { - UNITY_SETUP_INSTANCE_ID( IN ); + UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -2054,363 +2074,38 @@ Shader "FuseDissolver" #endif #endif - float2 uv_BaseMap = IN.ase_texcoord2.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; - float4 tex2DNode9 = tex2D( _BaseMap, uv_BaseMap ); + float2 uv_NormalMap = IN.ase_texcoord4.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - float dotResult6 = dot( _PlaneDirection , IN.ase_texcoord3.xyz ); - float simplePerlin3D1 = snoise( IN.ase_texcoord3.xyz*_NoiseScale ); + float2 uv_BaseMap = IN.ase_texcoord4.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; + float4 tex2DNode9 = tex2D( _BaseMap, uv_BaseMap ); + float dotResult6 = dot( _PlaneDirection , IN.ase_texcoord5.xyz ); + float simplePerlin3D1 = snoise( IN.ase_texcoord5.xyz*_NoiseScale ); simplePerlin3D1 = simplePerlin3D1*0.5 + 0.5; - - float3 Albedo = tex2DNode9.rgb; + float3 Normal = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); float Alpha = saturate( ( tex2DNode9.a * ( _PlaneOffset + dotResult6 + ( simplePerlin3D1 - 0.5 ) ) ) ); float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); + #ifdef ASE_DEPTH_WRITE_ON + float DepthValue = 0; + #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - #define ASE_NEEDS_FRAG_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - float4 ase_texcoord5 : TEXCOORD5; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseMap_ST; - float4 _NormalMap_ST; - float4 _EmissionMap_ST; - float4 _MetallicSmoothnessMap_ST; - float3 _PlaneDirection; - float _PlaneOffset; - float _NoiseScale; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _NormalMap; - sampler2D _BaseMap; - - - float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; } - float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; } - float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); } - float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; } - float snoise( float3 v ) - { - const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 ); - float3 i = floor( v + dot( v, C.yyy ) ); - float3 x0 = v - i + dot( i, C.xxx ); - float3 g = step( x0.yzx, x0.xyz ); - float3 l = 1.0 - g; - float3 i1 = min( g.xyz, l.zxy ); - float3 i2 = max( g.xyz, l.zxy ); - float3 x1 = x0 - i1 + C.xxx; - float3 x2 = x0 - i2 + C.yyy; - float3 x3 = x0 - 0.5; - i = mod3D289( i); - float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) ); - float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7) - float4 x_ = floor( j / 7.0 ); - float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N) - float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0; - float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0; - float4 h = 1.0 - abs( x ) - abs( y ); - float4 b0 = float4( x.xy, y.xy ); - float4 b1 = float4( x.zw, y.zw ); - float4 s0 = floor( b0 ) * 2.0 + 1.0; - float4 s1 = floor( b1 ) * 2.0 + 1.0; - float4 sh = -step( h, 0.0 ); - float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; - float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - float3 g0 = float3( a0.xy, h.x ); - float3 g1 = float3( a0.zw, h.y ); - float3 g2 = float3( a1.xy, h.z ); - float3 g3 = float3( a1.zw, h.w ); - float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) ); - g0 *= norm.x; - g1 *= norm.y; - g2 *= norm.z; - g3 *= norm.w; - float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 ); - m = m* m; - m = m* m; - float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) ); - return 42.0 * dot( m, px); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - o.ase_texcoord5 = v.vertex; - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_NormalMap = IN.ase_texcoord4.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - - float2 uv_BaseMap = IN.ase_texcoord4.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; - float4 tex2DNode9 = tex2D( _BaseMap, uv_BaseMap ); - float dotResult6 = dot( _PlaneDirection , IN.ase_texcoord5.xyz ); - float simplePerlin3D1 = snoise( IN.ase_texcoord5.xyz*_NoiseScale ); - simplePerlin3D1 = simplePerlin3D1*0.5 + 0.5; - - float3 Normal = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - float Alpha = saturate( ( tex2DNode9.a * ( _PlaneOffset + dotResult6 + ( simplePerlin3D1 - 0.5 ) ) ) ); - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); + + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); #else #if defined(_NORMALMAP) @@ -2434,529 +2129,6 @@ Shader "FuseDissolver" } - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - float4 ase_texcoord9 : TEXCOORD9; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseMap_ST; - float4 _NormalMap_ST; - float4 _EmissionMap_ST; - float4 _MetallicSmoothnessMap_ST; - float3 _PlaneDirection; - float _PlaneOffset; - float _NoiseScale; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _BaseMap; - sampler2D _NormalMap; - sampler2D _EmissionMap; - sampler2D _MetallicSmoothnessMap; - - - float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; } - float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; } - float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); } - float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; } - float snoise( float3 v ) - { - const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 ); - float3 i = floor( v + dot( v, C.yyy ) ); - float3 x0 = v - i + dot( i, C.xxx ); - float3 g = step( x0.yzx, x0.xyz ); - float3 l = 1.0 - g; - float3 i1 = min( g.xyz, l.zxy ); - float3 i2 = max( g.xyz, l.zxy ); - float3 x1 = x0 - i1 + C.xxx; - float3 x2 = x0 - i2 + C.yyy; - float3 x3 = x0 - 0.5; - i = mod3D289( i); - float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) ); - float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7) - float4 x_ = floor( j / 7.0 ); - float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N) - float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0; - float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0; - float4 h = 1.0 - abs( x ) - abs( y ); - float4 b0 = float4( x.xy, y.xy ); - float4 b1 = float4( x.zw, y.zw ); - float4 s0 = floor( b0 ) * 2.0 + 1.0; - float4 s1 = floor( b1 ) * 2.0 + 1.0; - float4 sh = -step( h, 0.0 ); - float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; - float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - float3 g0 = float3( a0.xy, h.x ); - float3 g1 = float3( a0.zw, h.y ); - float3 g2 = float3( a1.xy, h.z ); - float3 g3 = float3( a1.zw, h.w ); - float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) ); - g0 *= norm.x; - g1 *= norm.y; - g2 *= norm.z; - g3 *= norm.w; - float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 ); - m = m* m; - m = m* m; - float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) ); - return 42.0 * dot( m, px); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - o.ase_texcoord9 = v.vertex; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_BaseMap = IN.ase_texcoord8.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; - float4 tex2DNode9 = tex2D( _BaseMap, uv_BaseMap ); - - float2 uv_NormalMap = IN.ase_texcoord8.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - - float2 uv_EmissionMap = IN.ase_texcoord8.xy * _EmissionMap_ST.xy + _EmissionMap_ST.zw; - - float2 uv_MetallicSmoothnessMap = IN.ase_texcoord8.xy * _MetallicSmoothnessMap_ST.xy + _MetallicSmoothnessMap_ST.zw; - float4 tex2DNode12 = tex2D( _MetallicSmoothnessMap, uv_MetallicSmoothnessMap ); - - float dotResult6 = dot( _PlaneDirection , IN.ase_texcoord9.xyz ); - float simplePerlin3D1 = snoise( IN.ase_texcoord9.xyz*_NoiseScale ); - simplePerlin3D1 = simplePerlin3D1*0.5 + 0.5; - - float3 Albedo = tex2DNode9.rgb; - float3 Normal = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - float3 Emission = tex2D( _EmissionMap, uv_EmissionMap ).rgb; - float3 Specular = 0.5; - float Metallic = tex2DNode12.r; - float Smoothness = tex2DNode12.a; - float Occlusion = 1; - float Alpha = saturate( ( tex2DNode9.a * ( _PlaneOffset + dotResult6 + ( simplePerlin3D1 - 0.5 ) ) ) ); - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - Pass { @@ -2973,7 +2145,7 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma only_renderers d3d11 glcore gles gles3 ps5 @@ -3246,7 +2418,7 @@ Shader "FuseDissolver" #define _EMISSION #define _ALPHATEST_ON 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #pragma only_renderers d3d11 glcore gles gles3 ps5 @@ -3535,7 +2707,7 @@ Node;AmplifyShaderEditor.RangedFloatNode;3;-1337.654,730.063;Inherit;False;Prope Node;AmplifyShaderEditor.RangedFloatNode;7;-1338.565,82.40015;Inherit;False;Property;_PlaneOffset;PlaneOffset;3;0;Create;True;0;0;0;False;0;False;0;0;-30;30;0;1;FLOAT;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;24;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;17;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;0,0;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;FuseDissolver;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638122966127608817;LOD CrossFade;0;638122966132381224;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;638122966244444400;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;0,0;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;FuseDissolver;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638122966127608817;LOD CrossFade;0;638122966132381224;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;638122966244444400;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;False;True;False;True;True;False;;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;15;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;23;0,60;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;19;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 @@ -3562,4 +2734,4 @@ WireConnection;16;4;12;4 WireConnection;16;6;14;0 WireConnection;16;7;21;0 ASEEND*/ -//CHKSM=9E01666F38DF5C544CABDB2D9CD0F6BD82AE4DE5 \ No newline at end of file +//CHKSM=9E03C232B82E28A7A8CFCB53D48AC5C3B120AAB9 diff --git a/Assets/KoboldKare/Shaders/Kobold.shader b/Assets/KoboldKare/Shaders/Kobold.shader index 2265d607d..691c0d6ee 100644 --- a/Assets/KoboldKare/Shaders/Kobold.shader +++ b/Assets/KoboldKare/Shaders/Kobold.shader @@ -195,27 +195,27 @@ Shader "Kobold" #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -239,8 +239,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_FRAG_WORLD_VIEW_DIR #define ASE_NEEDS_FRAG_WORLD_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -878,7 +878,7 @@ Shader "Kobold" #pragma vertex vert #pragma fragment frag - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW +#pragma multi_compile __ _CASTING_PUNCTUAL_LIGHT_SHADOW #define SHADERPASS SHADERPASS_SHADOWCASTER @@ -893,8 +893,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_FRAG_WORLD_POSITION #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -1306,8 +1306,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_FRAG_WORLD_POSITION #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -1652,775 +1652,6 @@ Shader "Kobold" } - Pass - { - - Name "Meta" - Tags { "LightMode"="Meta" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #define _ALPHATEST_SHADOW_ON 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _CLEARCOAT 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON - #pragma multi_compile_instancing - #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif - float4 ase_texcoord4 : TEXCOORD4; - float4 ase_texcoord5 : TEXCOORD5; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _SubsurfaceColor; - float _CompressibleDistance; - float _Smoothness; - float _DetailTiling; - float _DetailAlpha; - float _DetailNormalScale; - float _BoobLerp; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - sampler2D _DetailMaskMap; - sampler2D _BaseColorMap; - sampler2D _DecalColorMap; - UNITY_INSTANCING_BUFFER_START(Kobold) - UNITY_DEFINE_INSTANCED_PROP(float4, _HueBrightnessContrastSaturation) - UNITY_DEFINE_INSTANCED_PROP(float4, _BaseColorMap_ST) - UNITY_DEFINE_INSTANCED_PROP(float, _Head) - UNITY_INSTANCING_BUFFER_END(Kobold) - - - float3 GetSoftbodyOffset3_g38( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - float4 MyCustomExpression1_g34( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g38 = length( v.ase_color.r ); - float localGetDeformationFromPenetrators_float8_g37 = ( 0.0 ); - float4 appendResult17_g37 = (float4(v.vertex.xyz , 1.0)); - float4 transform16_g37 = mul(GetObjectToWorldMatrix(),appendResult17_g37); - float3 worldPosition8_g37 = (transform16_g37).xyz; - float4 texCoord3_g37 = v.texcoord2; - texCoord3_g37.xy = v.texcoord2.xy * float2( 1,1 ) + float2( 0,0 ); - float4 uv28_g37 = texCoord3_g37; - float compressibleDistance8_g37 = _CompressibleDistance; - float smoothness8_g37 = _Smoothness; - float3 deformedPosition8_g37 = float3( 0,0,0 ); - { - GetDeformationFromPenetrators_float(worldPosition8_g37,uv28_g37,compressibleDistance8_g37,smoothness8_g37,deformedPosition8_g37); - } - float4 appendResult21_g37 = (float4(deformedPosition8_g37 , 1.0)); - float4 transform19_g37 = mul(GetWorldToObjectMatrix(),appendResult21_g37); - #ifdef _PENETRATION_DEFORMATION_ON - float3 staticSwitch24_g37 = (transform19_g37).xyz; - #else - float3 staticSwitch24_g37 = v.vertex.xyz; - #endif - float3 lerpResult85 = lerp( v.vertex.xyz , staticSwitch24_g37 , v.ase_color.g); - float3 vertexPosition3_g38 = lerpResult85; - float3 localGetSoftbodyOffset3_g38 = GetSoftbodyOffset3_g38( blend3_g38 , vertexPosition3_g38 ); - - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord5.xyz = ase_worldNormal; - - o.ase_texcoord4.xy = v.texcoord0.xy; - o.ase_texcoord4.zw = v.texcoord1.xy; - o.ase_color = v.ase_color; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord5.w = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = ( localGetSoftbodyOffset3_g38 + lerpResult85 ); - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float4 _HueBrightnessContrastSaturation_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_HueBrightnessContrastSaturation); - float4 hsbc1_g34 = _HueBrightnessContrastSaturation_Instance; - float2 temp_cast_0 = (_DetailTiling).xx; - float2 texCoord104 = IN.ase_texcoord4.xy * temp_cast_0 + float2( 0,0 ); - float4 break110 = tex2D( _DetailMaskMap, texCoord104 ); - float4 appendResult111 = (float4(break110.r , break110.g , break110.b , 1.0)); - float4 _BaseColorMap_ST_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_BaseColorMap_ST); - float2 uv_BaseColorMap = IN.ase_texcoord4.xy * _BaseColorMap_ST_Instance.xy + _BaseColorMap_ST_Instance.zw; - float4 blendOpSrc106 = appendResult111; - float4 blendOpDest106 = tex2D( _BaseColorMap, uv_BaseColorMap ); - float2 uv_DetailMaskMap113 = IN.ase_texcoord4.xy; - float4 tex2DNode113 = tex2D( _DetailMaskMap, uv_DetailMaskMap113 ); - float lerpResult109 = lerp( 0.0 , _DetailAlpha , tex2DNode113.a); - float4 lerpBlendMode106 = lerp(blendOpDest106,(( blendOpDest106 > 0.5 ) ? ( 1.0 - 2.0 * ( 1.0 - blendOpDest106 ) * ( 1.0 - blendOpSrc106 ) ) : ( 2.0 * blendOpDest106 * blendOpSrc106 ) ),lerpResult109); - float4 startColor1_g34 = ( saturate( lerpBlendMode106 )); - float4 localMyCustomExpression1_g34 = MyCustomExpression1_g34( hsbc1_g34 , startColor1_g34 ); - float2 texCoord2_g36 = IN.ase_texcoord4.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode3_g36 = tex2Dlod( _DecalColorMap, float4( texCoord2_g36, 0, 0.0) ); - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float3 ase_worldNormal = IN.ase_texcoord5.xyz; - float fresnelNdotV16_g36 = dot( ase_worldNormal, ase_worldViewDir ); - float fresnelNode16_g36 = ( 0.6 + 1.0 * pow( max( 1.0 - fresnelNdotV16_g36 , 0.0001 ), 2.0 ) ); - float4 lerpResult7_g36 = lerp( localMyCustomExpression1_g34 , tex2DNode3_g36 , saturate( ( tex2DNode3_g36.a * fresnelNode16_g36 ) )); - float4 break76 = lerpResult7_g36; - float _Head_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_Head); - float lerpResult44 = lerp( IN.ase_color.a , break76.a , _Head_Instance); - float temp_output_70_0 = saturate( lerpResult44 ); - float4 appendResult72 = (float4(break76.r , break76.g , break76.b , temp_output_70_0)); - - - float3 Albedo = appendResult72.xyz; - float3 Emission = 0; - float Alpha = temp_output_70_0; - float AlphaClipThreshold = 0.5; - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif - - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #define _ALPHATEST_SHADOW_ON 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _CLEARCOAT 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON - #pragma multi_compile_instancing - #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _SubsurfaceColor; - float _CompressibleDistance; - float _Smoothness; - float _DetailTiling; - float _DetailAlpha; - float _DetailNormalScale; - float _BoobLerp; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - sampler2D _DetailMaskMap; - sampler2D _BaseColorMap; - sampler2D _DecalColorMap; - UNITY_INSTANCING_BUFFER_START(Kobold) - UNITY_DEFINE_INSTANCED_PROP(float4, _HueBrightnessContrastSaturation) - UNITY_DEFINE_INSTANCED_PROP(float4, _BaseColorMap_ST) - UNITY_DEFINE_INSTANCED_PROP(float, _Head) - UNITY_INSTANCING_BUFFER_END(Kobold) - - - float3 GetSoftbodyOffset3_g38( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - float4 MyCustomExpression1_g34( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float blend3_g38 = length( v.ase_color.r ); - float localGetDeformationFromPenetrators_float8_g37 = ( 0.0 ); - float4 appendResult17_g37 = (float4(v.vertex.xyz , 1.0)); - float4 transform16_g37 = mul(GetObjectToWorldMatrix(),appendResult17_g37); - float3 worldPosition8_g37 = (transform16_g37).xyz; - float4 texCoord3_g37 = v.ase_texcoord2; - texCoord3_g37.xy = v.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 ); - float4 uv28_g37 = texCoord3_g37; - float compressibleDistance8_g37 = _CompressibleDistance; - float smoothness8_g37 = _Smoothness; - float3 deformedPosition8_g37 = float3( 0,0,0 ); - { - GetDeformationFromPenetrators_float(worldPosition8_g37,uv28_g37,compressibleDistance8_g37,smoothness8_g37,deformedPosition8_g37); - } - float4 appendResult21_g37 = (float4(deformedPosition8_g37 , 1.0)); - float4 transform19_g37 = mul(GetWorldToObjectMatrix(),appendResult21_g37); - #ifdef _PENETRATION_DEFORMATION_ON - float3 staticSwitch24_g37 = (transform19_g37).xyz; - #else - float3 staticSwitch24_g37 = v.vertex.xyz; - #endif - float3 lerpResult85 = lerp( v.vertex.xyz , staticSwitch24_g37 , v.ase_color.g); - float3 vertexPosition3_g38 = lerpResult85; - float3 localGetSoftbodyOffset3_g38 = GetSoftbodyOffset3_g38( blend3_g38 , vertexPosition3_g38 ); - - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord3.xyz = ase_worldNormal; - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - o.ase_texcoord2.zw = v.ase_texcoord1.xy; - o.ase_color = v.ase_color; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord3.w = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = ( localGetSoftbodyOffset3_g38 + lerpResult85 ); - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - o.ase_texcoord2 = v.ase_texcoord2; - o.ase_texcoord = v.ase_texcoord; - o.ase_texcoord1 = v.ase_texcoord1; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - o.ase_texcoord2 = patch[0].ase_texcoord2 * bary.x + patch[1].ase_texcoord2 * bary.y + patch[2].ase_texcoord2 * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float4 _HueBrightnessContrastSaturation_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_HueBrightnessContrastSaturation); - float4 hsbc1_g34 = _HueBrightnessContrastSaturation_Instance; - float2 temp_cast_0 = (_DetailTiling).xx; - float2 texCoord104 = IN.ase_texcoord2.xy * temp_cast_0 + float2( 0,0 ); - float4 break110 = tex2D( _DetailMaskMap, texCoord104 ); - float4 appendResult111 = (float4(break110.r , break110.g , break110.b , 1.0)); - float4 _BaseColorMap_ST_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_BaseColorMap_ST); - float2 uv_BaseColorMap = IN.ase_texcoord2.xy * _BaseColorMap_ST_Instance.xy + _BaseColorMap_ST_Instance.zw; - float4 blendOpSrc106 = appendResult111; - float4 blendOpDest106 = tex2D( _BaseColorMap, uv_BaseColorMap ); - float2 uv_DetailMaskMap113 = IN.ase_texcoord2.xy; - float4 tex2DNode113 = tex2D( _DetailMaskMap, uv_DetailMaskMap113 ); - float lerpResult109 = lerp( 0.0 , _DetailAlpha , tex2DNode113.a); - float4 lerpBlendMode106 = lerp(blendOpDest106,(( blendOpDest106 > 0.5 ) ? ( 1.0 - 2.0 * ( 1.0 - blendOpDest106 ) * ( 1.0 - blendOpSrc106 ) ) : ( 2.0 * blendOpDest106 * blendOpSrc106 ) ),lerpResult109); - float4 startColor1_g34 = ( saturate( lerpBlendMode106 )); - float4 localMyCustomExpression1_g34 = MyCustomExpression1_g34( hsbc1_g34 , startColor1_g34 ); - float2 texCoord2_g36 = IN.ase_texcoord2.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode3_g36 = tex2Dlod( _DecalColorMap, float4( texCoord2_g36, 0, 0.0) ); - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float3 ase_worldNormal = IN.ase_texcoord3.xyz; - float fresnelNdotV16_g36 = dot( ase_worldNormal, ase_worldViewDir ); - float fresnelNode16_g36 = ( 0.6 + 1.0 * pow( max( 1.0 - fresnelNdotV16_g36 , 0.0001 ), 2.0 ) ); - float4 lerpResult7_g36 = lerp( localMyCustomExpression1_g34 , tex2DNode3_g36 , saturate( ( tex2DNode3_g36.a * fresnelNode16_g36 ) )); - float4 break76 = lerpResult7_g36; - float _Head_Instance = UNITY_ACCESS_INSTANCED_PROP(Kobold,_Head); - float lerpResult44 = lerp( IN.ase_color.a , break76.a , _Head_Instance); - float temp_output_70_0 = saturate( lerpResult44 ); - float4 appendResult72 = (float4(break76.r , break76.g , break76.b , temp_output_70_0)); - - - float3 Albedo = appendResult72.xyz; - float Alpha = temp_output_70_0; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -2460,8 +1691,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_FRAG_WORLD_POSITION #define ASE_NEEDS_FRAG_WORLD_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -2886,8 +2117,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -3235,8 +2466,8 @@ Shader "Kobold" #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_VERT_NORMAL - #pragma shader_feature_local _PENETRATION_DEFORMATION_DETAIL_ON - #pragma shader_feature_local _PENETRATION_DEFORMATION_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_DETAIL_ON +#pragma shader_feature_local __ _PENETRATION_DEFORMATION_ON #pragma multi_compile_instancing #include "Packages/com.naelstrof.penetrationtech/Shaders/Penetration.cginc" @@ -3609,7 +2840,7 @@ Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;67;925.674,-72.54388;Float; Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;64;925.674,-72.54388;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;66;925.674,-72.54388;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;88;2152.365,-91.9964;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;61;2152.365,-171.9964;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Kobold;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;1;0; Transmission Shadow;1,False,;0;Translucency;1;0; Translucency Strength;1,False,;0; Normal Distortion;1,False,;0; Scattering;2,False,;0; Direct;1,False,;0; Ambient;0.2,False,;0; Shadow;1,False,;0;Cast Shadows;1;0; Use Shadow Threshold;1;0;Receive Shadows;1;0;GPU Instancing;0;0;LOD CrossFade;0;638123054158872191;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;1;637974989309817492;0;10;False;True;True;True;True;True;True;False;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;61;2152.365,-171.9964;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Kobold;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;1;0; Transmission Shadow;1,False,;0;Translucency;1;0; Translucency Strength;1,False,;0; Normal Distortion;1,False,;0; Scattering;2,False,;0; Direct;1,False,;0; Ambient;0.2,False,;0; Shadow;1,False,;0;Cast Shadows;1;0; Use Shadow Threshold;1;0;Receive Shadows;1;0;GPU Instancing;0;0;LOD CrossFade;0;638123054158872191;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;0;638349143991051084;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;1;637974989309817492;0;10;False;True;True;True;False;False;True;False;True;True;False;;False;0 WireConnection;104;0;103;0 WireConnection;114;0;115;0 WireConnection;114;1;104;0 @@ -3679,4 +2910,4 @@ WireConnection;61;18;99;20 WireConnection;61;19;99;18 WireConnection;61;8;87;0 ASEEND*/ -//CHKSM=988560C51D0CBC0C2C1BC2F1C2D600FE4BF3AC5E \ No newline at end of file +//CHKSM=46C84B39D66775696B54BD86DCE117C9C144ED7D diff --git a/Assets/KoboldKare/Shaders/KoboldBasic.shader b/Assets/KoboldKare/Shaders/KoboldBasic.shader index 4df71989b..e6f8a10d1 100644 --- a/Assets/KoboldKare/Shaders/KoboldBasic.shader +++ b/Assets/KoboldKare/Shaders/KoboldBasic.shader @@ -178,27 +178,27 @@ Shader "KoboldBasic" #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -1023,7 +1023,7 @@ Shader "KoboldBasic" #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1931,21 +1931,21 @@ Shader "KoboldBasic" #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED +#pragma multi_compile __ _SHADOWS_SOFT +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _GBUFFER_NORMALS_OCT +#pragma multi_compile __ _LIGHT_LAYERS +#pragma multi_compile __ _RENDER_PASS_ENABLED #pragma vertex vert #pragma fragment frag @@ -2877,4 +2877,4 @@ WireConnection;61;4;75;3 WireConnection;61;18;99;20 WireConnection;61;19;99;18 ASEEND*/ -//CHKSM=A52833FDF13F72D44C1369306C07FBA9B19BB80B \ No newline at end of file +//CHKSM=A52833FDF13F72D44C1369306C07FBA9B19BB80B diff --git a/Assets/KoboldKare/Shaders/Leafs URP.shader b/Assets/KoboldKare/Shaders/Leafs URP.shader index 9b670f71f..4e0b0fe68 100644 --- a/Assets/KoboldKare/Shaders/Leafs URP.shader +++ b/Assets/KoboldKare/Shaders/Leafs URP.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor v1.9.1.5 +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Mtree/SRP/Leafs URP" { @@ -1602,7 +1602,7 @@ Shader "Mtree/SRP/Leafs URP" #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION + #pragma shader_feature_local _ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1975,11 +1975,13 @@ Shader "Mtree/SRP/Leafs URP" Pass { - Name "Universal2D" - Tags { "LightMode"="Universal2D" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Blend One Zero, One Zero - ColorMask RGBA + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM @@ -1996,16 +1998,13 @@ Shader "Mtree/SRP/Leafs URP" #pragma vertex vert #pragma fragment frag - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + #define ASE_NEEDS_VERT_POSITION #define ASE_NEEDS_VERT_NORMAL @@ -2014,6 +2013,7 @@ Shader "Mtree/SRP/Leafs URP" { float4 vertex : POSITION; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_color : COLOR; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID @@ -2028,8 +2028,9 @@ Shader "Mtree/SRP/Leafs URP" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - float4 ase_color : COLOR; - float4 ase_texcoord2 : TEXCOORD2; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + float4 ase_texcoord4 : TEXCOORD4; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -2076,6 +2077,7 @@ Shader "Mtree/SRP/Leafs URP" float _WindPulse; float _WindDirection; float _WindTurbulence; + sampler2D _BumpMap; sampler2D _MainTex; @@ -2097,29 +2099,13 @@ Shader "Mtree/SRP/Leafs URP" return Output; } - float3 HSVToRGB( float3 c ) - { - float4 K = float4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 ); - float3 p = abs( frac( c.xxx + K.xyz ) * 6.0 - K.www ); - return c.z * lerp( K.xxx, saturate( p - K.xxx ), c.y ); - } - - float3 RGBToHSV(float3 c) - { - float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - float4 p = lerp( float4( c.bg, K.wz ), float4( c.gb, K.xy ), step( c.b, c.g ) ); - float4 q = lerp( float4( p.xyw, c.r ), float4( c.r, p.yzx ), step( p.x, c.r ) ); - float d = q.x - min( q.w, q.y ); - float e = 1.0e-10; - return float3( abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); - } VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); int m_Switch252_g499 = _WindModeLeaves; float3 VAR_VertexPosition21_g499 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; @@ -2170,12 +2156,10 @@ Shader "Mtree/SRP/Leafs URP" float3 temp_output_5_0_g499 = mul( GetWorldToObjectMatrix(), float4( OUT_Leafs262_g499 , 0.0 ) ).xyz; float3 OUT_VertexPos261 = temp_output_5_0_g499; - o.ase_color = v.ase_color; - o.ase_texcoord2.xy = v.ase_texcoord.xy; + o.ase_texcoord4.xy = v.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - + o.ase_texcoord4.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else @@ -2189,21 +2173,24 @@ Shader "Mtree/SRP/Leafs URP" #endif v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); float4 positionCS = TransformWorldToHClip( positionWS ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; o.shadowCoord = GetShadowCoord( vertexInput ); #endif - o.clipPos = positionCS; return o; } @@ -2213,6 +2200,7 @@ Shader "Mtree/SRP/Leafs URP" { float4 vertex : INTERNALTESSPOS; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_color : COLOR; float4 ase_texcoord : TEXCOORD0; @@ -2232,6 +2220,7 @@ Shader "Mtree/SRP/Leafs URP" UNITY_TRANSFER_INSTANCE_ID(v, o); o.vertex = v.vertex; o.ase_normal = v.ase_normal; + o.ase_tangent = v.ase_tangent; o.ase_color = v.ase_color; o.ase_texcoord = v.ase_texcoord; return o; @@ -2272,6 +2261,7 @@ Shader "Mtree/SRP/Leafs URP" VertexInput o = (VertexInput) 0; o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; + o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) @@ -2291,15 +2281,27 @@ Shader "Mtree/SRP/Leafs URP" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { - UNITY_SETUP_INSTANCE_ID( IN ); + UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -2309,1012 +2311,58 @@ Shader "Mtree/SRP/Leafs URP" #endif #endif - float2 uv_MainTex = IN.ase_texcoord2.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 tex2DNode13 = tex2D( _MainTex, uv_MainTex ); - float4 VAR_AlbedoTexture267 = tex2DNode13; - float4 VAR_Albedo101 = ( _Color * VAR_AlbedoTexture267 ); - float4 VAR_Albedo18_g498 = VAR_Albedo101; - float3 hsvTorgb9_g498 = RGBToHSV( VAR_Albedo18_g498.rgb ); - float3 hsvTorgb13_g498 = HSVToRGB( float3(( ( ( IN.ase_color.g - 0.5 ) * _ColorVariation ) + _Hue + hsvTorgb9_g498 ).x,( hsvTorgb9_g498.y * _Saturation ),( hsvTorgb9_g498.z * _Value )) ); - float4 lerpResult19_g498 = lerp( float4( hsvTorgb13_g498 , 0.0 ) , VAR_Albedo18_g498 , (float)_ColorShifting); - float4 OUT_Albedo254 = lerpResult19_g498; + float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; + float3 unpack53 = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), _BumpScale ); + unpack53.z = lerp( 1, unpack53.z, saturate(_BumpScale) ); + float3 OUT_Normal255 = unpack53; + float2 uv_MainTex = IN.ase_texcoord4.xy * _MainTex_ST.xy + _MainTex_ST.zw; + float4 tex2DNode13 = tex2D( _MainTex, uv_MainTex ); float OUT_Alpha46 = tex2DNode13.a; - - float3 Albedo = OUT_Albedo254.rgb; + float3 Normal = OUT_Normal255; float Alpha = OUT_Alpha46; float AlphaClipThreshold = _Cutoff; - - half4 color = half4( Albedo, Alpha ); + #ifdef ASE_DEPTH_WRITE_ON + float DepthValue = 0; + #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_VERT_NORMAL - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; + + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float4 _MainTex_ST; - float4 _BumpMap_ST; - int _WindModeLeaves; - float _GlobalWindInfluence; - float _GlobalTurbulenceInfluence; - float _ColorVariation; - half _Hue; - float _Saturation; - float _Value; - int _ColorShifting; - half _BumpScale; - float _Metallic; - float _Glossiness; - half _OcclusionStrength; - half _Cutoff; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - float _WindTurbulence; - sampler2D _BumpMap; - sampler2D _MainTex; - + + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); + #else + + #if defined(_NORMALMAP) + #if _NORMAL_DROPOFF_TS + float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); + float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); + float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); + #elif _NORMAL_DROPOFF_OS + float3 normalWS = TransformObjectToWorldNormal(Normal); + #elif _NORMAL_DROPOFF_WS + float3 normalWS = Normal; + #endif + #else + float3 normalWS = WorldNormal; + #endif - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - float3 If252_g499( int m_Switch, float3 m_Leaves, float3 m_Palm, float3 m_Grass, float3 m_None ) - { - float3 Output = m_None; - if(m_Switch == 0){Output = m_Leaves;} - if(m_Switch == 1){Output = m_Palm;} - if(m_Switch == 2){Output = m_Grass;} - if(m_Switch == 3){Output = m_None;} - return Output; + return half4(NormalizeNormalPerPixel(normalWS), 0.0); + #endif } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - int m_Switch252_g499 = _WindModeLeaves; - float3 VAR_VertexPosition21_g499 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g499 = VAR_VertexPosition21_g499; - float VAR_WindStrength43_g499 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g499 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g499 = (float2(transform37_g499.x , transform37_g499.z)); - float dotResult2_g500 = dot( appendResult38_g499 , float2( 12.9898,78.233 ) ); - float lerpResult8_g500 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g500 ) * 43758.55 ) )); - float VAR_RandomTime16_g499 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g500 ); - float FUNC_Turbulence36_g499 = ( sin( ( ( VAR_RandomTime16_g499 * 40.0 ) - ( VAR_VertexPosition21_g499.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g499 = _WindPulse; - float FUNC_Angle73_g499 = ( VAR_WindStrength43_g499 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g499 * 2.0 ) + FUNC_Turbulence36_g499 ) - ( VAR_VertexPosition21_g499.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g499 ); - float VAR_SinA80_g499 = sin( FUNC_Angle73_g499 ); - float VAR_CosA78_g499 = cos( FUNC_Angle73_g499 ); - float _WindDirection164_g499 = _WindDirection; - float2 localDirectionalEquation164_g499 = DirectionalEquation( _WindDirection164_g499 ); - float2 break165_g499 = localDirectionalEquation164_g499; - float VAR_xLerp83_g499 = break165_g499.x; - float lerpResult118_g499 = lerp( break109_g499.x , ( ( break109_g499.y * VAR_SinA80_g499 ) + ( break109_g499.x * VAR_CosA78_g499 ) ) , VAR_xLerp83_g499); - float3 break98_g499 = VAR_VertexPosition21_g499; - float3 break105_g499 = VAR_VertexPosition21_g499; - float VAR_zLerp95_g499 = break165_g499.y; - float lerpResult120_g499 = lerp( break105_g499.z , ( ( break105_g499.y * VAR_SinA80_g499 ) + ( break105_g499.z * VAR_CosA78_g499 ) ) , VAR_zLerp95_g499); - float3 appendResult122_g499 = (float3(lerpResult118_g499 , ( ( break98_g499.y * VAR_CosA78_g499 ) - ( break98_g499.z * VAR_SinA80_g499 ) ) , lerpResult120_g499)); - float3 FUNC_vertexPos123_g499 = appendResult122_g499; - float3 break236_g499 = FUNC_vertexPos123_g499; - half FUNC_SinFunction195_g499 = sin( ( ( VAR_RandomTime16_g499 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g499 + ( VAR_VertexPosition21_g499.z / 2.0 ) ) ); - float VAR_GlobalWindTurbulence194_g499 = ( _WindTurbulence * _GlobalTurbulenceInfluence ); - float3 appendResult237_g499 = (float3(break236_g499.x , ( break236_g499.y + ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) * VAR_GlobalWindTurbulence194_g499 ) ) , break236_g499.z)); - float3 OUT_Leafs_Standalone244_g499 = appendResult237_g499; - float3 m_Leaves252_g499 = OUT_Leafs_Standalone244_g499; - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - float3 normalizedWorldNormal = normalize( ase_worldNormal ); - float3 appendResult234_g499 = (float3(( normalizedWorldNormal.x * v.ase_color.g ) , ( normalizedWorldNormal.y / v.ase_color.r ) , ( normalizedWorldNormal.z * v.ase_color.g ))); - float3 OUT_Palm_Standalone243_g499 = ( ( ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) * VAR_GlobalWindTurbulence194_g499 ) * appendResult234_g499 ) + FUNC_vertexPos123_g499 ); - float3 m_Palm252_g499 = OUT_Palm_Standalone243_g499; - float3 break221_g499 = FUNC_vertexPos123_g499; - float temp_output_202_0_g499 = ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) ); - float lerpResult203_g499 = lerp( 0.0 , temp_output_202_0_g499 , VAR_xLerp83_g499); - float lerpResult196_g499 = lerp( 0.0 , temp_output_202_0_g499 , VAR_zLerp95_g499); - float3 appendResult197_g499 = (float3(( break221_g499.x + lerpResult203_g499 ) , break221_g499.y , ( break221_g499.z + lerpResult196_g499 ))); - float3 OUT_Grass_Standalone245_g499 = appendResult197_g499; - float3 m_Grass252_g499 = OUT_Grass_Standalone245_g499; - float3 m_None252_g499 = FUNC_vertexPos123_g499; - float3 localIf252_g499 = If252_g499( m_Switch252_g499 , m_Leaves252_g499 , m_Palm252_g499 , m_Grass252_g499 , m_None252_g499 ); - float3 OUT_Leafs262_g499 = localIf252_g499; - float3 temp_output_5_0_g499 = mul( GetWorldToObjectMatrix(), float4( OUT_Leafs262_g499 , 0.0 ) ).xyz; - float3 OUT_VertexPos261 = temp_output_5_0_g499; - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = OUT_VertexPos261; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_color = v.ase_color; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float3 unpack53 = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), _BumpScale ); - unpack53.z = lerp( 1, unpack53.z, saturate(_BumpScale) ); - float3 OUT_Normal255 = unpack53; - - float2 uv_MainTex = IN.ase_texcoord4.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 tex2DNode13 = tex2D( _MainTex, uv_MainTex ); - float OUT_Alpha46 = tex2DNode13.a; - - float3 Normal = OUT_Normal255; - float Alpha = OUT_Alpha46; - float AlphaClipThreshold = _Cutoff; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - #define ASE_NEEDS_VERT_NORMAL - #define ASE_NEEDS_FRAG_COLOR - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_color : COLOR; - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float4 _MainTex_ST; - float4 _BumpMap_ST; - int _WindModeLeaves; - float _GlobalWindInfluence; - float _GlobalTurbulenceInfluence; - float _ColorVariation; - half _Hue; - float _Saturation; - float _Value; - int _ColorShifting; - half _BumpScale; - float _Metallic; - float _Glossiness; - half _OcclusionStrength; - half _Cutoff; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - float _WindTurbulence; - sampler2D _MainTex; - sampler2D _BumpMap; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - float3 If252_g499( int m_Switch, float3 m_Leaves, float3 m_Palm, float3 m_Grass, float3 m_None ) - { - float3 Output = m_None; - if(m_Switch == 0){Output = m_Leaves;} - if(m_Switch == 1){Output = m_Palm;} - if(m_Switch == 2){Output = m_Grass;} - if(m_Switch == 3){Output = m_None;} - return Output; - } - - float3 HSVToRGB( float3 c ) - { - float4 K = float4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 ); - float3 p = abs( frac( c.xxx + K.xyz ) * 6.0 - K.www ); - return c.z * lerp( K.xxx, saturate( p - K.xxx ), c.y ); - } - - float3 RGBToHSV(float3 c) - { - float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - float4 p = lerp( float4( c.bg, K.wz ), float4( c.gb, K.xy ), step( c.b, c.g ) ); - float4 q = lerp( float4( p.xyw, c.r ), float4( c.r, p.yzx ), step( p.x, c.r ) ); - float d = q.x - min( q.w, q.y ); - float e = 1.0e-10; - return float3( abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); - } - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - int m_Switch252_g499 = _WindModeLeaves; - float3 VAR_VertexPosition21_g499 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g499 = VAR_VertexPosition21_g499; - float VAR_WindStrength43_g499 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g499 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g499 = (float2(transform37_g499.x , transform37_g499.z)); - float dotResult2_g500 = dot( appendResult38_g499 , float2( 12.9898,78.233 ) ); - float lerpResult8_g500 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g500 ) * 43758.55 ) )); - float VAR_RandomTime16_g499 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g500 ); - float FUNC_Turbulence36_g499 = ( sin( ( ( VAR_RandomTime16_g499 * 40.0 ) - ( VAR_VertexPosition21_g499.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g499 = _WindPulse; - float FUNC_Angle73_g499 = ( VAR_WindStrength43_g499 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g499 * 2.0 ) + FUNC_Turbulence36_g499 ) - ( VAR_VertexPosition21_g499.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g499 ); - float VAR_SinA80_g499 = sin( FUNC_Angle73_g499 ); - float VAR_CosA78_g499 = cos( FUNC_Angle73_g499 ); - float _WindDirection164_g499 = _WindDirection; - float2 localDirectionalEquation164_g499 = DirectionalEquation( _WindDirection164_g499 ); - float2 break165_g499 = localDirectionalEquation164_g499; - float VAR_xLerp83_g499 = break165_g499.x; - float lerpResult118_g499 = lerp( break109_g499.x , ( ( break109_g499.y * VAR_SinA80_g499 ) + ( break109_g499.x * VAR_CosA78_g499 ) ) , VAR_xLerp83_g499); - float3 break98_g499 = VAR_VertexPosition21_g499; - float3 break105_g499 = VAR_VertexPosition21_g499; - float VAR_zLerp95_g499 = break165_g499.y; - float lerpResult120_g499 = lerp( break105_g499.z , ( ( break105_g499.y * VAR_SinA80_g499 ) + ( break105_g499.z * VAR_CosA78_g499 ) ) , VAR_zLerp95_g499); - float3 appendResult122_g499 = (float3(lerpResult118_g499 , ( ( break98_g499.y * VAR_CosA78_g499 ) - ( break98_g499.z * VAR_SinA80_g499 ) ) , lerpResult120_g499)); - float3 FUNC_vertexPos123_g499 = appendResult122_g499; - float3 break236_g499 = FUNC_vertexPos123_g499; - half FUNC_SinFunction195_g499 = sin( ( ( VAR_RandomTime16_g499 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g499 + ( VAR_VertexPosition21_g499.z / 2.0 ) ) ); - float VAR_GlobalWindTurbulence194_g499 = ( _WindTurbulence * _GlobalTurbulenceInfluence ); - float3 appendResult237_g499 = (float3(break236_g499.x , ( break236_g499.y + ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) * VAR_GlobalWindTurbulence194_g499 ) ) , break236_g499.z)); - float3 OUT_Leafs_Standalone244_g499 = appendResult237_g499; - float3 m_Leaves252_g499 = OUT_Leafs_Standalone244_g499; - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - float3 normalizedWorldNormal = normalize( ase_worldNormal ); - float3 appendResult234_g499 = (float3(( normalizedWorldNormal.x * v.ase_color.g ) , ( normalizedWorldNormal.y / v.ase_color.r ) , ( normalizedWorldNormal.z * v.ase_color.g ))); - float3 OUT_Palm_Standalone243_g499 = ( ( ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) * VAR_GlobalWindTurbulence194_g499 ) * appendResult234_g499 ) + FUNC_vertexPos123_g499 ); - float3 m_Palm252_g499 = OUT_Palm_Standalone243_g499; - float3 break221_g499 = FUNC_vertexPos123_g499; - float temp_output_202_0_g499 = ( FUNC_SinFunction195_g499 * v.ase_color.b * ( FUNC_Angle73_g499 + ( VAR_WindStrength43_g499 / 200.0 ) ) ); - float lerpResult203_g499 = lerp( 0.0 , temp_output_202_0_g499 , VAR_xLerp83_g499); - float lerpResult196_g499 = lerp( 0.0 , temp_output_202_0_g499 , VAR_zLerp95_g499); - float3 appendResult197_g499 = (float3(( break221_g499.x + lerpResult203_g499 ) , break221_g499.y , ( break221_g499.z + lerpResult196_g499 ))); - float3 OUT_Grass_Standalone245_g499 = appendResult197_g499; - float3 m_Grass252_g499 = OUT_Grass_Standalone245_g499; - float3 m_None252_g499 = FUNC_vertexPos123_g499; - float3 localIf252_g499 = If252_g499( m_Switch252_g499 , m_Leaves252_g499 , m_Palm252_g499 , m_Grass252_g499 , m_None252_g499 ); - float3 OUT_Leafs262_g499 = localIf252_g499; - float3 temp_output_5_0_g499 = mul( GetWorldToObjectMatrix(), float4( OUT_Leafs262_g499 , 0.0 ) ).xyz; - float3 OUT_VertexPos261 = temp_output_5_0_g499; - - o.ase_color = v.ase_color; - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = OUT_VertexPos261; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_MainTex = IN.ase_texcoord8.xy * _MainTex_ST.xy + _MainTex_ST.zw; - float4 tex2DNode13 = tex2D( _MainTex, uv_MainTex ); - float4 VAR_AlbedoTexture267 = tex2DNode13; - float4 VAR_Albedo101 = ( _Color * VAR_AlbedoTexture267 ); - float4 VAR_Albedo18_g498 = VAR_Albedo101; - float3 hsvTorgb9_g498 = RGBToHSV( VAR_Albedo18_g498.rgb ); - float3 hsvTorgb13_g498 = HSVToRGB( float3(( ( ( IN.ase_color.g - 0.5 ) * _ColorVariation ) + _Hue + hsvTorgb9_g498 ).x,( hsvTorgb9_g498.y * _Saturation ),( hsvTorgb9_g498.z * _Value )) ); - float4 lerpResult19_g498 = lerp( float4( hsvTorgb13_g498 , 0.0 ) , VAR_Albedo18_g498 , (float)_ColorShifting); - float4 OUT_Albedo254 = lerpResult19_g498; - - float2 uv_BumpMap = IN.ase_texcoord8.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float3 unpack53 = UnpackNormalScale( tex2D( _BumpMap, uv_BumpMap ), _BumpScale ); - unpack53.z = lerp( 1, unpack53.z, saturate(_BumpScale) ); - float3 OUT_Normal255 = unpack53; - - float lerpResult268 = lerp( 0.0 , VAR_AlbedoTexture267.r , _Glossiness); - float OUT_Smoothness50 = lerpResult268; - - float lerpResult41 = lerp( 1.0 , IN.ase_color.a , _OcclusionStrength); - float OUT_AO44 = lerpResult41; - - float OUT_Alpha46 = tex2DNode13.a; - - float3 temp_cast_6 = (OUT_AO44).xxx; - - float3 Albedo = OUT_Albedo254.rgb; - float3 Normal = OUT_Normal255; - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = OUT_Smoothness50; - float Occlusion = OUT_AO44; - float Alpha = OUT_Alpha46; - float AlphaClipThreshold = _Cutoff; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = temp_cast_6; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - ENDHLSL } @@ -3998,7 +3046,7 @@ Node;AmplifyShaderEditor.RangedFloatNode;48;-1483.599,-551.3174;Half;False;Prope Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;381;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;384;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;383;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;382;1279.325,-379.9919;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Mtree/SRP/Leafs URP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;0;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;1;0; Translucency Strength;1,False,;0; Normal Distortion;0.916,False,;0; Scattering;1,False,;0; Direct;0.921,False,;0; Ambient;0.158,False,;0; Shadow;0.848,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638123050950925978;LOD CrossFade;0;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;638123050970380931;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;382;1279.325,-379.9919;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Mtree/SRP/Leafs URP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;0;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;1;0; Translucency Strength;1,False,;0; Normal Distortion;0.916,False,;0; Scattering;1,False,;0; Direct;0.921,False,;0; Ambient;0.158,False,;0; Shadow;0.848,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638123050950925978;LOD CrossFade;0;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;638123050970380931;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;False;True;False;True;True;False;;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;385;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;388;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;386;1279.325,-379.9919;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 @@ -4040,4 +3088,4 @@ WireConnection;382;7;30;0 WireConnection;382;15;357;0 WireConnection;382;8;258;0 ASEEND*/ -//CHKSM=E909B60511BCCA6D332DF1931585575E6A656403 \ No newline at end of file +//CHKSM=7372D0813E0EFC34317E1AC6B0A73D86E7ADFCF5 diff --git a/Assets/KoboldKare/Shaders/MappedDecalable.shader b/Assets/KoboldKare/Shaders/MappedDecalable.shader index 4db68e64e..4dbe74434 100644 --- a/Assets/KoboldKare/Shaders/MappedDecalable.shader +++ b/Assets/KoboldKare/Shaders/MappedDecalable.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor v1.9.1.5 +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "MappedDecalable" { @@ -1343,7 +1343,7 @@ Shader "MappedDecalable" #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION + #pragma shader_feature_local _ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1617,277 +1617,6 @@ Shader "MappedDecalable" } - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _CLEARCOAT 1 - #define _ALPHATEST_ON 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseMap_ST; - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - TEXTURE2D(_BaseMap); - SAMPLER(sampler_BaseMap); - TEXTURE2D(_DecalColorMap); - SAMPLER(sampler_DecalColorMap); - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord3.xyz = ase_worldNormal; - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - o.ase_texcoord2.zw = v.ase_texcoord1.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord3.w = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - o.ase_texcoord1 = v.ase_texcoord1; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BaseMap = IN.ase_texcoord2.xy * _BaseMap_ST.xy + _BaseMap_ST.zw; - float2 texCoord2_g2 = IN.ase_texcoord2.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode3_g2 = SAMPLE_TEXTURE2D_LOD( _DecalColorMap, sampler_DecalColorMap, texCoord2_g2, 0.0 ); - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float3 ase_worldNormal = IN.ase_texcoord3.xyz; - float fresnelNdotV16_g2 = dot( ase_worldNormal, ase_worldViewDir ); - float fresnelNode16_g2 = ( 0.6 + 1.0 * pow( max( 1.0 - fresnelNdotV16_g2 , 0.0001 ), 2.0 ) ); - float4 lerpResult7_g2 = lerp( ( SAMPLE_TEXTURE2D( _BaseMap, sampler_BaseMap, uv_BaseMap ) * _Color ) , tex2DNode3_g2 , saturate( ( tex2DNode3_g2.a * fresnelNode16_g2 ) )); - float4 temp_output_90_13 = lerpResult7_g2; - - - float3 Albedo = temp_output_90_13.rgb; - float Alpha = temp_output_90_13.a; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -2717,7 +2446,7 @@ Node;AmplifyShaderEditor.RangedFloatNode;77;1182.551,452.657;Inherit;False;Const Node;AmplifyShaderEditor.BreakToComponentsNode;73;1058.729,294.426;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;85;1516.614,280.9744;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;86;1516.614,280.9744;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;82;1516.614,280.9744;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;MappedDecalable;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638122957168188167;LOD CrossFade;0;638122957183238664;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975008662224862;0;10;False;True;True;True;True;True;True;False;True;True;False;;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;82;1516.614,280.9744;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;MappedDecalable;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638122957168188167;LOD CrossFade;0;638122957183238664;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975008662224862;0;10;False;True;True;True;True;False;True;False;True;True;False;;True;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;81;1516.614,280.9744;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;88;1516.614,280.9744;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;96;1516.614,360.9744;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 @@ -2759,4 +2488,4 @@ WireConnection;7;1;61;0 WireConnection;8;1;61;0 WireConnection;98;1;61;0 ASEEND*/ -//CHKSM=A440BDD09B99C55426FFCF067EBB5113E7FE0CAE \ No newline at end of file +//CHKSM=44504D2C0A45AD342640AA2BF76FE0ED319EEDE5 diff --git a/Assets/KoboldKare/Shaders/MirrorShader.shader b/Assets/KoboldKare/Shaders/MirrorShader.shader deleted file mode 100644 index 4b8e0bf84..000000000 --- a/Assets/KoboldKare/Shaders/MirrorShader.shader +++ /dev/null @@ -1,3045 +0,0 @@ -// Made with Amplify Shader Editor -// Available at the Unity Asset Store - http://u3d.as/y3X -Shader "MirrorShader" -{ - Properties - { - [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 - [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) - [ASEBegin]_LocalReflectionMap("_LocalReflectionMap", 2D) = "white" {} - _Smoothness("Smoothness", Range( 0 , 1)) = 0.8 - _NormalMap("NormalMap", 2D) = "bump" {} - _MirrorSmudges("MirrorSmudges", 2D) = "black" {} - _Metallic("Metallic", Range( 0 , 1)) = 0 - [ASEEnd]_NormalWarping("NormalWarping", Range( 0 , 1)) = 0.1 - [HideInInspector] _texcoord( "", 2D ) = "white" {} - - [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0 - [HideInInspector]_QueueControl("_QueueControl", Float) = -1 - [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} - //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5 - //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1 - //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5 - //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2 - //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9 - //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1 - //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5 - //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5 - //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16 - //_TessMin( "Tess Min Distance", Float ) = 10 - //_TessMax( "Tess Max Distance", Float ) = 25 - //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16 - //_TessMaxDisp( "Tess Max Displacement", Float ) = 25 - } - - SubShader - { - LOD 0 - - - - Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" } - Cull Back - ZWrite On - ZTest LEqual - Offset 0 , 0 - AlphaToMask Off - - HLSLINCLUDE - #pragma target 3.0 - - #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x - - #ifndef ASE_TESS_FUNCS - #define ASE_TESS_FUNCS - float4 FixedTess( float tessValue ) - { - return tessValue; - } - - float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos ) - { - float3 wpos = mul(o2w,vertex).xyz; - float dist = distance (wpos, cameraPos); - float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess; - return f; - } - - float4 CalcTriEdgeTessFactors (float3 triVertexFactors) - { - float4 tess; - tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z); - tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z); - tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y); - tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f; - return tess; - } - - float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams ) - { - float dist = distance (0.5 * (wpos0+wpos1), cameraPos); - float len = distance(wpos0, wpos1); - float f = max(len * scParams.y / (edgeLen * dist), 1.0); - return f; - } - - float DistanceFromPlane (float3 pos, float4 plane) - { - float d = dot (float4(pos,1.0f), plane); - return d; - } - - bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] ) - { - float4 planeTest; - planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f ); - return !all (planeTest); - } - - float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos ) - { - float3 f; - f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos); - f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos); - f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos); - - return CalcTriEdgeTessFactors (f); - } - - float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - return tess; - } - - float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - - if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes)) - { - tess = 0.0f; - } - else - { - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - } - return tess; - } - #endif //ASE_TESS_FUNCS - - ENDHLSL - - - Pass - { - - Name "Forward" - Tags { "LightMode"="UniversalForward" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK - - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS - - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_FORWARD - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_SCREEN_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _MirrorSmudges; - sampler2D _NormalMap; - sampler2D _LocalReflectionMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - #if defined(LIGHTMAP_ON) - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - #if !defined(LIGHTMAP_ON) - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_Target - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_MirrorSmudges = IN.ase_texcoord8.xy * _MirrorSmudges_ST.xy + _MirrorSmudges_ST.zw; - float4 tex2DNode26 = tex2D( _MirrorSmudges, uv_MirrorSmudges ); - - float2 uv_NormalMap = IN.ase_texcoord8.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - float3 tex2DNode20 = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - - float4 ase_screenPosNorm = ScreenPos / ScreenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float4 lerpResult27 = lerp( tex2D( _LocalReflectionMap, ( ase_screenPosNorm + float4( ( ( tex2DNode20 - float3( 0.5,0.5,0.5 ) ) * _NormalWarping ) , 0.0 ) ).xy ) , float4( 0,0,0,0 ) , tex2DNode26.r); - - float3 Albedo = tex2DNode26.rgb; - float3 Normal = tex2DNode20; - float3 Emission = lerpResult27.rgb; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = _Smoothness; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _CLEARCOAT - float CoatMask = 0; - float CoatSmoothness = 0; - #endif - - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.viewDirectionWS = WorldViewDirection; - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - #else - inputData.normalWS = WorldNormal; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - inputData.shadowCoord = ShadowCoords; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); - #else - inputData.shadowCoord = float4(0, 0, 0, 0); - #endif - - - #ifdef ASE_FOG - inputData.fogCoord = IN.fogFactorAndVertexLight.x; - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - SurfaceData surfaceData; - surfaceData.albedo = Albedo; - surfaceData.metallic = saturate(Metallic); - surfaceData.specular = Specular; - surfaceData.smoothness = saturate(Smoothness), - surfaceData.occlusion = Occlusion, - surfaceData.emission = Emission, - surfaceData.alpha = saturate(Alpha); - surfaceData.normalTS = Normal; - surfaceData.clearCoatMask = 0; - surfaceData.clearCoatSmoothness = 1; - - - #ifdef _CLEARCOAT - surfaceData.clearCoatMask = saturate(CoatMask); - surfaceData.clearCoatSmoothness = saturate(CoatSmoothness); - #endif - - #ifdef _DBUFFER - ApplyDecalToSurfaceData(IN.clipPos, surfaceData, inputData); - #endif - - half4 color = UniversalFragmentPBR( inputData, surfaceData); - - #ifdef _TRANSMISSION_ASE - { - float shadow = _TransmissionShadow; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission; - color.rgb += Albedo * mainTransmission; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission; - color.rgb += Albedo * transmission; - } - #endif - } - #endif - - #ifdef _TRANSLUCENCY_ASE - { - float shadow = _TransShadow; - float normal = _TransNormal; - float scattering = _TransScattering; - float direct = _TransDirect; - float ambient = _TransAmbient; - float strength = _TransStrength; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - - half3 mainLightDir = mainLight.direction + inputData.normalWS * normal; - half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering ); - half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * mainTranslucency * strength; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 lightDir = light.direction + inputData.normalWS * normal; - half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering ); - half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * translucency * strength; - } - #endif - } - #endif - - #ifdef _REFRACTION_ASE - float4 projScreenPos = ScreenPos / ScreenPos.w; - float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) ); - projScreenPos.xy += refractionOffset.xy; - float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor; - color.rgb = lerp( refraction, color.rgb, color.a ); - color.a = 1; - #endif - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return color; - } - - ENDHLSL - } - - - Pass - { - - Name "ShadowCaster" - Tags { "LightMode"="ShadowCaster" } - - ZWrite On - ZTest LEqual - AlphaToMask Off - ColorMask 0 - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW - - #define SHADERPASS SHADERPASS_SHADOWCASTER - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - float3 _LightDirection; - float3 _LightPosition; - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - float3 normalWS = TransformObjectToWorldDir(v.ase_normal); - - - #if _CASTING_PUNCTUAL_LIGHT_SHADOW - float3 lightDirectionWS = normalize(_LightPosition - positionWS); - #else - float3 lightDirectionWS = _LightDirection; - #endif - - float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); - - #if UNITY_REVERSED_Z - clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #else - clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #endif - - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = clipPos; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - #ifdef _ALPHATEST_SHADOW_ON - clip(Alpha - AlphaClipThresholdShadow); - #else - clip(Alpha - AlphaClipThreshold); - #endif - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - return 0; - } - - ENDHLSL - } - - - Pass - { - - Name "DepthOnly" - Tags { "LightMode"="DepthOnly" } - - ZWrite On - ColorMask 0 - AlphaToMask Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return 0; - } - ENDHLSL - } - - - Pass - { - - Name "Meta" - Tags { "LightMode"="Meta" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif - float4 ase_texcoord4 : TEXCOORD4; - float4 ase_texcoord5 : TEXCOORD5; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _MirrorSmudges; - sampler2D _LocalReflectionMap; - sampler2D _NormalMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz); - float4 screenPos = ComputeScreenPos(ase_clipPos); - o.ase_texcoord5 = screenPos; - - o.ase_texcoord4.xy = v.texcoord0.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_MirrorSmudges = IN.ase_texcoord4.xy * _MirrorSmudges_ST.xy + _MirrorSmudges_ST.zw; - float4 tex2DNode26 = tex2D( _MirrorSmudges, uv_MirrorSmudges ); - - float4 screenPos = IN.ase_texcoord5; - float4 ase_screenPosNorm = screenPos / screenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float2 uv_NormalMap = IN.ase_texcoord4.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - float3 tex2DNode20 = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - float4 lerpResult27 = lerp( tex2D( _LocalReflectionMap, ( ase_screenPosNorm + float4( ( ( tex2DNode20 - float3( 0.5,0.5,0.5 ) ) * _NormalWarping ) , 0.0 ) ).xy ) , float4( 0,0,0,0 ) , tex2DNode26.r); - - - float3 Albedo = tex2DNode26.rgb; - float3 Emission = lerpResult27.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif - - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _MirrorSmudges; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_MirrorSmudges = IN.ase_texcoord2.xy * _MirrorSmudges_ST.xy + _MirrorSmudges_ST.zw; - float4 tex2DNode26 = tex2D( _MirrorSmudges, uv_MirrorSmudges ); - - - float3 Albedo = tex2DNode26.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _NormalMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_NormalMap = IN.ase_texcoord4.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - float3 tex2DNode20 = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - - float3 Normal = tex2DNode20; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_SCREEN_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _MirrorSmudges; - sampler2D _NormalMap; - sampler2D _LocalReflectionMap; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 uv_MirrorSmudges = IN.ase_texcoord8.xy * _MirrorSmudges_ST.xy + _MirrorSmudges_ST.zw; - float4 tex2DNode26 = tex2D( _MirrorSmudges, uv_MirrorSmudges ); - - float2 uv_NormalMap = IN.ase_texcoord8.xy * _NormalMap_ST.xy + _NormalMap_ST.zw; - float3 tex2DNode20 = UnpackNormalScale( tex2D( _NormalMap, uv_NormalMap ), 1.0f ); - - float4 ase_screenPosNorm = ScreenPos / ScreenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float4 lerpResult27 = lerp( tex2D( _LocalReflectionMap, ( ase_screenPosNorm + float4( ( ( tex2DNode20 - float3( 0.5,0.5,0.5 ) ) * _NormalWarping ) , 0.0 ) ).xy ) , float4( 0,0,0,0 ) , tex2DNode26.r); - - float3 Albedo = tex2DNode26.rgb; - float3 Normal = tex2DNode20; - float3 Emission = lerpResult27.rgb; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = _Smoothness; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - - Pass - { - - Name "SceneSelectionPass" - Tags { "LightMode"="SceneSelectionPass" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - int _ObjectId; - int _PassValue; - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); - return outColor; - } - - ENDHLSL - } - - - Pass - { - - Name "ScenePickingPass" - Tags { "LightMode"="Picking" } - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _MirrorSmudges_ST; - float4 _NormalMap_ST; - float _NormalWarping; - float _Metallic; - float _Smoothness; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - - float4 _SelectionID; - - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = 0; - outColor = _SelectionID; - - return outColor; - } - - ENDHLSL - } - - } - - CustomEditor "UnityEditor.ShaderGraphLitGUI" - Fallback "Hidden/InternalErrorShader" - -} -/*ASEBEGIN -Version=18935 -188;366;1800;766;1317.52;964.977;1;True;False -Node;AmplifyShaderEditor.SamplerNode;20;-1540.05,-649.8992;Inherit;True;Property;_NormalMap;NormalMap;2;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.RangedFloatNode;28;-553.2816,-182.2128;Inherit;False;Property;_Metallic;Metallic;4;0;Create;True;0;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.RangedFloatNode;18;-528.6519,-5.636205;Inherit;False;Property;_Smoothness;Smoothness;1;0;Create;True;0;0;0;False;0;False;0.8;1;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.SamplerNode;26;-613.7566,-790.7047;Inherit;True;Property;_MirrorSmudges;MirrorSmudges;3;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;black;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.SamplerNode;6;-598.9228,-538.2449;Inherit;True;Property;_LocalReflectionMap;_LocalReflectionMap;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.LerpOp;27;-215.058,-514.6061;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0 -Node;AmplifyShaderEditor.SimpleMultiplyOpNode;22;-980.5745,-515.0534;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0 -Node;AmplifyShaderEditor.ScreenPosInputsNode;11;-974.243,-288.7053;Float;False;0;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.RangedFloatNode;23;-1317.713,-398.5505;Inherit;False;Property;_NormalWarping;NormalWarping;5;0;Create;True;0;0;0;False;0;False;0.1;0.15;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.SimpleSubtractOpNode;29;-1181.839,-555.9625;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0.5,0.5,0.5;False;1;FLOAT3;0 -Node;AmplifyShaderEditor.SimpleAddOpNode;21;-747.8948,-540.3793;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT4;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;32;4.926554,-237.2902;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;12;-41.15425,-594.2902;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;30;4.926554,-534.2902;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;14;-41.15425,-117.1313;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;15;-41.15425,-117.1313;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;-41.15425,-117.1313;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;17;-41.15425,-117.1313;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;13;4.926554,-594.2902;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;MirrorShader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;31;4.926554,-594.2902;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;33;4.926554,-237.2902;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -WireConnection;6;1;21;0 -WireConnection;27;0;6;0 -WireConnection;27;2;26;1 -WireConnection;22;0;29;0 -WireConnection;22;1;23;0 -WireConnection;29;0;20;0 -WireConnection;21;0;11;0 -WireConnection;21;1;22;0 -WireConnection;13;0;26;0 -WireConnection;13;1;20;0 -WireConnection;13;2;27;0 -WireConnection;13;3;28;0 -WireConnection;13;4;18;0 -ASEEND*/ -//CHKSM=60C20F61FEAF5F13C15B3705E84DB9B6C6113E34 \ No newline at end of file diff --git a/Assets/KoboldKare/Shaders/MirrorShader.shader.meta b/Assets/KoboldKare/Shaders/MirrorShader.shader.meta deleted file mode 100644 index 475d78950..000000000 --- a/Assets/KoboldKare/Shaders/MirrorShader.shader.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: f3eb94885c6507b4f8064bffd462d7fa -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Shaders/NipplePiercingShader.shader b/Assets/KoboldKare/Shaders/NipplePiercingShader.shader deleted file mode 100644 index 8bbd840df..000000000 --- a/Assets/KoboldKare/Shaders/NipplePiercingShader.shader +++ /dev/null @@ -1,3084 +0,0 @@ -// Made with Amplify Shader Editor v1.9.1.5 -// Available at the Unity Asset Store - http://u3d.as/y3X -Shader "NipplePiercingShader" -{ - Properties - { - [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 - [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) - [ASEBegin]_Metallic("Metallic", Range( 0 , 1)) = 1 - _Smoothness("Smoothness", Range( 0 , 1)) = 0.9529412 - [ASEEnd]_Color("Color", Color) = (0,0,0,0) - - [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0 - [HideInInspector]_QueueControl("_QueueControl", Float) = -1 - [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} - //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5 - //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1 - //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5 - //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2 - //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9 - //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1 - //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5 - //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5 - //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16 - //_TessMin( "Tess Min Distance", Float ) = 10 - //_TessMax( "Tess Max Distance", Float ) = 25 - //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16 - //_TessMaxDisp( "Tess Max Displacement", Float ) = 25 - } - - SubShader - { - LOD 0 - - - - Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" } - Cull Back - ZWrite On - ZTest LEqual - Offset 0 , 0 - AlphaToMask Off - - HLSLINCLUDE - #pragma target 3.0 - - #pragma prefer_hlslcc gles - - - #ifndef ASE_TESS_FUNCS - #define ASE_TESS_FUNCS - float4 FixedTess( float tessValue ) - { - return tessValue; - } - - float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos ) - { - float3 wpos = mul(o2w,vertex).xyz; - float dist = distance (wpos, cameraPos); - float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess; - return f; - } - - float4 CalcTriEdgeTessFactors (float3 triVertexFactors) - { - float4 tess; - tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z); - tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z); - tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y); - tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f; - return tess; - } - - float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams ) - { - float dist = distance (0.5 * (wpos0+wpos1), cameraPos); - float len = distance(wpos0, wpos1); - float f = max(len * scParams.y / (edgeLen * dist), 1.0); - return f; - } - - float DistanceFromPlane (float3 pos, float4 plane) - { - float d = dot (float4(pos,1.0f), plane); - return d; - } - - bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] ) - { - float4 planeTest; - planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f ); - return !all (planeTest); - } - - float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos ) - { - float3 f; - f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos); - f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos); - f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos); - - return CalcTriEdgeTessFactors (f); - } - - float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - return tess; - } - - float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - - if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes)) - { - tess = 0.0f; - } - else - { - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - } - return tess; - } - #endif //ASE_TESS_FUNCS - - ENDHLSL - - - Pass - { - - Name "Forward" - Tags { "LightMode"="UniversalForward" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK - - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS - - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_FORWARD - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - #if defined(LIGHTMAP_ON) - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - #if !defined(LIGHTMAP_ON) - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_Target - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - - float3 Albedo = _Color.rgb; - float3 Normal = float3(0, 0, 1); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = _Smoothness; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _CLEARCOAT - float CoatMask = 0; - float CoatSmoothness = 0; - #endif - - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.viewDirectionWS = WorldViewDirection; - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - #else - inputData.normalWS = WorldNormal; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - inputData.shadowCoord = ShadowCoords; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); - #else - inputData.shadowCoord = float4(0, 0, 0, 0); - #endif - - - #ifdef ASE_FOG - inputData.fogCoord = IN.fogFactorAndVertexLight.x; - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - SurfaceData surfaceData; - surfaceData.albedo = Albedo; - surfaceData.metallic = saturate(Metallic); - surfaceData.specular = Specular; - surfaceData.smoothness = saturate(Smoothness), - surfaceData.occlusion = Occlusion, - surfaceData.emission = Emission, - surfaceData.alpha = saturate(Alpha); - surfaceData.normalTS = Normal; - surfaceData.clearCoatMask = 0; - surfaceData.clearCoatSmoothness = 1; - - - #ifdef _CLEARCOAT - surfaceData.clearCoatMask = saturate(CoatMask); - surfaceData.clearCoatSmoothness = saturate(CoatSmoothness); - #endif - - #ifdef _DBUFFER - ApplyDecalToSurfaceData(IN.clipPos, surfaceData, inputData); - #endif - - half4 color = UniversalFragmentPBR( inputData, surfaceData); - - #ifdef _TRANSMISSION_ASE - { - float shadow = _TransmissionShadow; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission; - color.rgb += Albedo * mainTransmission; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission; - color.rgb += Albedo * transmission; - } - #endif - } - #endif - - #ifdef _TRANSLUCENCY_ASE - { - float shadow = _TransShadow; - float normal = _TransNormal; - float scattering = _TransScattering; - float direct = _TransDirect; - float ambient = _TransAmbient; - float strength = _TransStrength; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - - half3 mainLightDir = mainLight.direction + inputData.normalWS * normal; - half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering ); - half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * mainTranslucency * strength; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 lightDir = light.direction + inputData.normalWS * normal; - half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering ); - half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * translucency * strength; - } - #endif - } - #endif - - #ifdef _REFRACTION_ASE - float4 projScreenPos = ScreenPos / ScreenPos.w; - float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) ); - projScreenPos.xy += refractionOffset.xy; - float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor; - color.rgb = lerp( refraction, color.rgb, color.a ); - color.a = 1; - #endif - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return color; - } - - ENDHLSL - } - - - Pass - { - - Name "ShadowCaster" - Tags { "LightMode"="ShadowCaster" } - - ZWrite On - ZTest LEqual - AlphaToMask Off - ColorMask 0 - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW - - #define SHADERPASS SHADERPASS_SHADOWCASTER - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - float3 _LightDirection; - float3 _LightPosition; - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - float3 normalWS = TransformObjectToWorldDir(v.ase_normal); - - - #if _CASTING_PUNCTUAL_LIGHT_SHADOW - float3 lightDirectionWS = normalize(_LightPosition - positionWS); - #else - float3 lightDirectionWS = _LightDirection; - #endif - - float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); - - #if UNITY_REVERSED_Z - clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #else - clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #endif - - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = clipPos; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - #ifdef _ALPHATEST_SHADOW_ON - clip(Alpha - AlphaClipThresholdShadow); - #else - clip(Alpha - AlphaClipThreshold); - #endif - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - return 0; - } - - ENDHLSL - } - - - Pass - { - - Name "DepthOnly" - Tags { "LightMode"="DepthOnly" } - - ZWrite On - ColorMask 0 - AlphaToMask Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return 0; - } - ENDHLSL - } - - - Pass - { - - Name "Meta" - Tags { "LightMode"="Meta" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - - float3 Albedo = _Color.rgb; - float3 Emission = 0; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif - - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - - float3 Albedo = _Color.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float3 Normal = float3(0, 0, 1); - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - - float3 Albedo = _Color.rgb; - float3 Normal = float3(0, 0, 1); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = _Smoothness; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - - Pass - { - - Name "SceneSelectionPass" - Tags { "LightMode"="SceneSelectionPass" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma only_renderers d3d11 glcore gles gles3 ps5 - #pragma vertex vert - #pragma fragment frag - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - int _ObjectId; - int _PassValue; - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); - return outColor; - } - - ENDHLSL - } - - - Pass - { - - Name "ScenePickingPass" - Tags { "LightMode"="Picking" } - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_SRP_VERSION 120110 - - - #pragma only_renderers d3d11 glcore gles gles3 ps5 - #pragma vertex vert - #pragma fragment frag - - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float _Metallic; - float _Smoothness; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - float4 _JiggleInfos[16]; - - - float3 GetSoftbodyOffset3_g1( float blend, float3 vertexPosition ) - { - float3 vertexOffset = float3(0,0,0); - for(int i=0;i<8;i++) { - float4 targetPosePositionRadius = _JiggleInfos[i*2]; - float4 verletPositionBlend = _JiggleInfos[i*2+1]; - float3 movement = (verletPositionBlend.xyz - targetPosePositionRadius.xyz); - float dist = distance(vertexPosition, targetPosePositionRadius.xyz); - float multi = 1-smoothstep(0,targetPosePositionRadius.w,dist); - vertexOffset += movement * multi * verletPositionBlend.w * blend; - } - return vertexOffset; - } - - - - float4 _SelectionID; - - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - float blend3_g1 = saturate( ( v.ase_color.r + v.ase_color.g + v.ase_color.b ) ); - float3 vertexPosition3_g1 = v.vertex.xyz; - float3 localGetSoftbodyOffset3_g1 = GetSoftbodyOffset3_g1( blend3_g1 , vertexPosition3_g1 ); - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = localGetSoftbodyOffset3_g1; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = 0; - outColor = _SelectionID; - - return outColor; - } - - ENDHLSL - } - - } - - CustomEditor "UnityEditor.ShaderGraphLitGUI" - Fallback "Hidden/InternalErrorShader" - -} -/*ASEBEGIN -Version=19105 -Node;AmplifyShaderEditor.FunctionNode;9;-411,209.5;Inherit;False;JigglePhysicsSoftbody;-1;;1;6ec46ef0369ac3449867136b98c25983;0;2;6;FLOAT3;0,0,0;False;10;FLOAT;0;False;1;FLOAT3;0 -Node;AmplifyShaderEditor.RangedFloatNode;11;-419,87.5;Inherit;False;Property;_Smoothness;Smoothness;1;0;Create;True;0;0;0;False;0;False;0.9529412;0;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.RangedFloatNode;10;-424,3.5;Inherit;False;Property;_Metallic;Metallic;0;0;Create;True;0;0;0;False;0;False;1;0;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.ColorNode;12;-333,-181.5;Inherit;False;Property;_Color;Color;2;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;0,0;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;NipplePiercingShader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638123058574710802;LOD CrossFade;0;638123058582046174;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;3;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;4;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;5;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;13;0,80;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;14;0,80;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -WireConnection;1;0;12;0 -WireConnection;1;3;10;0 -WireConnection;1;4;11;0 -WireConnection;1;8;9;0 -ASEEND*/ -//CHKSM=605FCCDBF1224FE508D36C628DA50A5B165F460B \ No newline at end of file diff --git a/Assets/KoboldKare/Shaders/NipplePiercingShader.shader.meta b/Assets/KoboldKare/Shaders/NipplePiercingShader.shader.meta deleted file mode 100644 index c1002e67f..000000000 --- a/Assets/KoboldKare/Shaders/NipplePiercingShader.shader.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 99d74aa18adfe114b8db023429c25ed2 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Shaders/Rock.shader b/Assets/KoboldKare/Shaders/Rock.shader index fd045e13e..f1b774141 100644 --- a/Assets/KoboldKare/Shaders/Rock.shader +++ b/Assets/KoboldKare/Shaders/Rock.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor v1.9.1.5 +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Rock" { @@ -55,7 +55,7 @@ Shader "Rock" #pragma target 3.0 #pragma prefer_hlslcc gles - + #pragma exclude_renderers xboxone xboxseries playstation ps4 ps5 switch #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -180,7 +180,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -804,7 +804,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -1089,7 +1089,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -1344,14 +1344,14 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION + #pragma shader_feature_local _ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1651,303 +1651,6 @@ Shader "Rock" } - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _CLEARCOAT 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BaseColor; - float4 _Data_ST; - float _RockTiling; - float _EdgeStrength; - float _Emissive; - float _SmoothPower; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - TEXTURE2D(_BaseColorMapRock); - SAMPLER(sampler_BaseColorMapRock); - TEXTURE2D(_Data); - SAMPLER(sampler_Data); - TEXTURE2D(_DecalColorMap); - SAMPLER(sampler_DecalColorMap); - - - inline float4 TriplanarSampling52( TEXTURE2D(topTexMap), SAMPLER(samplertopTexMap), float3 worldPos, float3 worldNormal, float falloff, float2 tiling, float3 normalScale, float3 index ) - { - float3 projNormal = ( pow( abs( worldNormal ), falloff ) ); - projNormal /= ( projNormal.x + projNormal.y + projNormal.z ) + 0.00001; - float3 nsign = sign( worldNormal ); - half4 xNorm; half4 yNorm; half4 zNorm; - xNorm = SAMPLE_TEXTURE2D( topTexMap, samplertopTexMap, tiling * worldPos.zy * float2( nsign.x, 1.0 ) ); - yNorm = SAMPLE_TEXTURE2D( topTexMap, samplertopTexMap, tiling * worldPos.xz * float2( nsign.y, 1.0 ) ); - zNorm = SAMPLE_TEXTURE2D( topTexMap, samplertopTexMap, tiling * worldPos.xy * float2( -nsign.z, 1.0 ) ); - return xNorm * projNormal.x + yNorm * projNormal.y + zNorm * projNormal.z; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord2.xyz = ase_worldNormal; - float3 normalizeWorldNormal = normalize( TransformObjectToWorldNormal(v.ase_normal) ); - o.ase_texcoord4.xyz = normalizeWorldNormal; - - o.ase_texcoord3.xy = v.ase_texcoord.xy; - o.ase_texcoord3.zw = v.ase_texcoord1.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.w = 0; - o.ase_texcoord4.w = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - o.ase_texcoord1 = v.ase_texcoord1; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 temp_cast_0 = (_RockTiling).xx; - float3 ase_worldNormal = IN.ase_texcoord2.xyz; - float4 triplanar52 = TriplanarSampling52( _BaseColorMapRock, sampler_BaseColorMapRock, WorldPosition, ase_worldNormal, 1.0, temp_cast_0, 1.0, 0 ); - float4 temp_output_60_0 = ( _BaseColor * triplanar52 ); - float4 color23 = IsGammaSpace() ? float4(1,1,1,0) : float4(1,1,1,0); - float2 uv_Data = IN.ase_texcoord3.xy * _Data_ST.xy + _Data_ST.zw; - float temp_output_24_0 = (0.0 + (SAMPLE_TEXTURE2D( _Data, sampler_Data, uv_Data ).r - 0.0) * (_EdgeStrength - 0.0) / (1.0 - 0.0)); - float4 lerpResult22 = lerp( temp_output_60_0 , color23 , temp_output_24_0); - float2 texCoord2_g62 = IN.ase_texcoord3.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode3_g62 = SAMPLE_TEXTURE2D_LOD( _DecalColorMap, sampler_DecalColorMap, texCoord2_g62, 0.0 ); - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float3 normalizeWorldNormal = IN.ase_texcoord4.xyz; - float fresnelNdotV16_g62 = dot( normalizeWorldNormal, ase_worldViewDir ); - float fresnelNode16_g62 = ( 0.6 + 1.0 * pow( max( 1.0 - fresnelNdotV16_g62 , 0.0001 ), 2.0 ) ); - float4 lerpResult7_g62 = lerp( lerpResult22 , tex2DNode3_g62 , saturate( ( tex2DNode3_g62.a * fresnelNode16_g62 ) )); - - - float3 Albedo = lerpResult7_g62.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -1967,7 +1670,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -2292,7 +1995,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -2505,7 +2208,7 @@ Shader "Rock" #define _CLEARCOAT 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120107 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -2746,7 +2449,7 @@ Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;0,33.76857;Float;False;Fa Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;3;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;829.2784,33.76857;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Rock;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637944995254856167;LOD CrossFade;0;638122957533994054;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975008891896708;0;10;False;True;True;True;True;True;True;False;True;True;False;;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;829.2784,33.76857;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Rock;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;6;d3d11;glcore;gles;gles3;metal;vulkan;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637944995254856167;LOD CrossFade;0;638122957533994054;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975008891896708;0;10;False;True;True;True;True;False;True;False;True;True;False;;True;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;8;0,33.76857;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;79;829.2784,113.7686;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;78;829.2784,113.7686;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 @@ -2788,4 +2491,4 @@ WireConnection;2;4;77;3 WireConnection;2;18;73;20 WireConnection;2;19;73;18 ASEEND*/ -//CHKSM=0258AAB7D742B610F8CE8EC68335E975194C073A \ No newline at end of file +//CHKSM=47173C53A91FF30D58E30EF88ABBDA07293BE9CB diff --git a/Assets/KoboldKare/Shaders/RunningWater.shader b/Assets/KoboldKare/Shaders/RunningWater.shader index 06e812181..83415ed44 100644 --- a/Assets/KoboldKare/Shaders/RunningWater.shader +++ b/Assets/KoboldKare/Shaders/RunningWater.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "naelstrof/RunningWater" { @@ -51,7 +51,7 @@ Shader "naelstrof/RunningWater" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -172,13 +172,11 @@ Shader "naelstrof/RunningWater" #define _NORMAL_DROPOFF_TS 1 #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define REQUIRE_DEPTH_TEXTURE 1 #define ASE_USING_SAMPLING_MACROS 1 @@ -802,13 +800,11 @@ Shader "naelstrof/RunningWater" #define _NORMAL_DROPOFF_TS 1 #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -1051,53 +1047,44 @@ Shader "naelstrof/RunningWater" Pass { - Name "Meta" - Tags { "LightMode"="Meta" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Cull Off + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM #define _NORMAL_DROPOFF_TS 1 #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - #define REQUIRE_DEPTH_TEXTURE 1 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + struct VertexInput { float4 vertex : POSITION; float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - + float4 ase_tangent : TANGENT; + float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -1110,10 +1097,8 @@ Shader "naelstrof/RunningWater" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; float4 ase_texcoord4 : TEXCOORD4; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO @@ -1147,28 +1132,11 @@ Shader "naelstrof/RunningWater" float _TessMaxDisp; #endif CBUFFER_END - uniform float4 _CameraDepthTexture_TexelSize; + TEXTURE2D(_BumpMap); + SAMPLER(sampler_BumpMap); - float2 UnStereo( float2 UV ) - { - #if UNITY_SINGLE_PASS_STEREO - float4 scaleOffset = unity_StereoScaleOffset[ unity_StereoEyeIndex ]; - UV.xy = (UV.xy - scaleOffset.zw) / scaleOffset.xy; - #endif - return UV; - } - - float3 InvertDepthDirURP75_g1( float3 In ) - { - float3 result = In; - #if !defined(ASE_SRP_VERSION) || ASE_SRP_VERSION <= 70301 || ASE_SRP_VERSION == 70503 || ASE_SRP_VERSION == 70600 || ASE_SRP_VERSION == 70700 || ASE_SRP_VERSION == 70701 || ASE_SRP_VERSION >= 80301 - result *= float3(1,1,-1); - #endif - return result; - } - VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; @@ -1176,11 +1144,10 @@ Shader "naelstrof/RunningWater" UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz); - float4 screenPos = ComputeScreenPos(ase_clipPos); - o.ase_texcoord4 = screenPos; - + o.ase_texcoord4.xy = v.ase_texcoord.xy; + //setting value to unused interpolator channels and avoid initialization warnings + o.ase_texcoord4.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else @@ -1194,28 +1161,25 @@ Shader "naelstrof/RunningWater" #endif v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); + float4 positionCS = TransformWorldToHClip( positionWS ); + #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) + VertexPositionInputs vertexInput = (VertexPositionInputs)0; + vertexInput.positionWS = positionWS; + vertexInput.positionCS = positionCS; + o.shadowCoord = GetShadowCoord( vertexInput ); + #endif + o.clipPos = positionCS; return o; } @@ -1224,10 +1188,9 @@ Shader "naelstrof/RunningWater" { float4 vertex : INTERNALTESSPOS; float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - + float4 ase_tangent : TANGENT; + float4 ase_texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -1244,10 +1207,8 @@ Shader "naelstrof/RunningWater" UNITY_TRANSFER_INSTANCE_ID(v, o); o.vertex = v.vertex; o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - + o.ase_tangent = v.ase_tangent; + o.ase_texcoord = v.ase_texcoord; return o; } @@ -1286,10 +1247,8 @@ Shader "naelstrof/RunningWater" VertexInput o = (VertexInput) 0; o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - + o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; + o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) @@ -1307,7 +1266,16 @@ Shader "naelstrof/RunningWater" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); @@ -1316,6 +1284,9 @@ Shader "naelstrof/RunningWater" float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -1325,1219 +1296,83 @@ Shader "naelstrof/RunningWater" #endif #endif - float4 screenPos = IN.ase_texcoord4; - float4 ase_screenPosNorm = screenPos / screenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float2 UV22_g3 = ase_screenPosNorm.xy; - float2 localUnStereo22_g3 = UnStereo( UV22_g3 ); - float2 break64_g1 = localUnStereo22_g3; - float clampDepth69_g1 = SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ); - #ifdef UNITY_REVERSED_Z - float staticSwitch38_g1 = ( 1.0 - clampDepth69_g1 ); - #else - float staticSwitch38_g1 = clampDepth69_g1; - #endif - float3 appendResult39_g1 = (float3(break64_g1.x , break64_g1.y , staticSwitch38_g1)); - float4 appendResult42_g1 = (float4((appendResult39_g1*2.0 + -1.0) , 1.0)); - float4 temp_output_43_0_g1 = mul( unity_CameraInvProjection, appendResult42_g1 ); - float3 temp_output_46_0_g1 = ( (temp_output_43_0_g1).xyz / (temp_output_43_0_g1).w ); - float3 In75_g1 = temp_output_46_0_g1; - float3 localInvertDepthDirURP75_g1 = InvertDepthDirURP75_g1( In75_g1 ); - float4 appendResult49_g1 = (float4(localInvertDepthDirURP75_g1 , 1.0)); - float saferPower180 = abs( ( _FogIntensity * -( distance( _WorldSpaceCameraPos , (mul( unity_CameraToWorld, appendResult49_g1 )).xyz ) - distance( _WorldSpaceCameraPos , WorldPosition ) ) ) ); - float temp_output_178_0 = exp2( pow( saferPower180 , 2.0 ) ); - float3 temp_cast_1 = (temp_output_178_0).xxx; - - float3 temp_cast_2 = (temp_output_178_0).xxx; - + float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; + float2 panner13 = ( 1.0 * _Time.y * _WaterSpeed + uv_BumpMap); + // *** BEGIN Flipbook UV Animation vars *** + // Total tiles of Flipbook Texture + float fbtotaltiles31 = 8.0 * 8.0; + // Offsets for cols and rows of Flipbook Texture + float fbcolsoffset31 = 1.0f / 8.0; + float fbrowsoffset31 = 1.0f / 8.0; + // Speed of animation + float fbspeed31 = _TimeParameters.x * _FrameRate; + // UV Tiling (col and row offset) + float2 fbtiling31 = float2(fbcolsoffset31, fbrowsoffset31); + // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset) + // Calculate current tile linear index + float fbcurrenttileindex31 = round( fmod( fbspeed31 + 0.0, fbtotaltiles31) ); + fbcurrenttileindex31 += ( fbcurrenttileindex31 < 0) ? fbtotaltiles31 : 0; + // Obtain Offset X coordinate from current tile linear index + float fblinearindextox31 = round ( fmod ( fbcurrenttileindex31, 8.0 ) ); + // Multiply Offset X by coloffset + float fboffsetx31 = fblinearindextox31 * fbcolsoffset31; + // Obtain Offset Y coordinate from current tile linear index + float fblinearindextoy31 = round( fmod( ( fbcurrenttileindex31 - fblinearindextox31 ) / 8.0, 8.0 ) ); + // Reverse Y to get tiles from Top to Bottom + fblinearindextoy31 = (int)(8.0-1) - fblinearindextoy31; + // Multiply Offset Y by rowoffset + float fboffsety31 = fblinearindextoy31 * fbrowsoffset31; + // UV Offset + float2 fboffset31 = float2(fboffsetx31, fboffsety31); + // Flipbook UV + half2 fbuv31 = frac( panner13 ) * fbtiling31 + fboffset31; + // *** END Flipbook UV Animation vars *** + float3 unpack29 = UnpackNormalScale( float4( UnpackNormalScale( SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, fbuv31 ), 1.0f ) , 0.0 ), _NormalScale ); + unpack29.z = lerp( 1, unpack29.z, saturate(_NormalScale) ); - float3 Albedo = temp_cast_1; - float3 Emission = temp_cast_2; + float3 Normal = unpack29; float Alpha = 1; float AlphaClipThreshold = 0.5; + #ifdef ASE_DEPTH_WRITE_ON + float DepthValue = 0; + #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); + #endif - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - #define REQUIRE_DEPTH_TEXTURE 1 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; + #endif - UNITY_VERTEX_INPUT_INSTANCE_ID - }; + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); + #else + + #if defined(_NORMALMAP) + #if _NORMAL_DROPOFF_TS + float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); + float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); + float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); + #elif _NORMAL_DROPOFF_OS + float3 normalWS = TransformObjectToWorldNormal(Normal); + #elif _NORMAL_DROPOFF_WS + float3 normalWS = Normal; + #endif + #else + float3 normalWS = WorldNormal; + #endif - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; + return half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif - float4 ase_texcoord2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BumpMap_ST; - float2 _WaterSpeed; - float _FogIntensity; - float _FrameRate; - float _NormalScale; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - uniform float4 _CameraDepthTexture_TexelSize; - - - float2 UnStereo( float2 UV ) - { - #if UNITY_SINGLE_PASS_STEREO - float4 scaleOffset = unity_StereoScaleOffset[ unity_StereoEyeIndex ]; - UV.xy = (UV.xy - scaleOffset.zw) / scaleOffset.xy; - #endif - return UV; - } - - float3 InvertDepthDirURP75_g1( float3 In ) - { - float3 result = In; - #if !defined(ASE_SRP_VERSION) || ASE_SRP_VERSION <= 70301 || ASE_SRP_VERSION == 70503 || ASE_SRP_VERSION == 70600 || ASE_SRP_VERSION == 70700 || ASE_SRP_VERSION == 70701 || ASE_SRP_VERSION >= 80301 - result *= float3(1,1,-1); - #endif - return result; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz); - float4 screenPos = ComputeScreenPos(ase_clipPos); - o.ase_texcoord2 = screenPos; - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float4 screenPos = IN.ase_texcoord2; - float4 ase_screenPosNorm = screenPos / screenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float2 UV22_g3 = ase_screenPosNorm.xy; - float2 localUnStereo22_g3 = UnStereo( UV22_g3 ); - float2 break64_g1 = localUnStereo22_g3; - float clampDepth69_g1 = SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ); - #ifdef UNITY_REVERSED_Z - float staticSwitch38_g1 = ( 1.0 - clampDepth69_g1 ); - #else - float staticSwitch38_g1 = clampDepth69_g1; - #endif - float3 appendResult39_g1 = (float3(break64_g1.x , break64_g1.y , staticSwitch38_g1)); - float4 appendResult42_g1 = (float4((appendResult39_g1*2.0 + -1.0) , 1.0)); - float4 temp_output_43_0_g1 = mul( unity_CameraInvProjection, appendResult42_g1 ); - float3 temp_output_46_0_g1 = ( (temp_output_43_0_g1).xyz / (temp_output_43_0_g1).w ); - float3 In75_g1 = temp_output_46_0_g1; - float3 localInvertDepthDirURP75_g1 = InvertDepthDirURP75_g1( In75_g1 ); - float4 appendResult49_g1 = (float4(localInvertDepthDirURP75_g1 , 1.0)); - float saferPower180 = abs( ( _FogIntensity * -( distance( _WorldSpaceCameraPos , (mul( unity_CameraToWorld, appendResult49_g1 )).xyz ) - distance( _WorldSpaceCameraPos , WorldPosition ) ) ) ); - float temp_output_178_0 = exp2( pow( saferPower180 , 2.0 ) ); - float3 temp_cast_1 = (temp_output_178_0).xxx; - - - float3 Albedo = temp_cast_1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BumpMap_ST; - float2 _WaterSpeed; - float _FogIntensity; - float _FrameRate; - float _NormalScale; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - TEXTURE2D(_BumpMap); - SAMPLER(sampler_BumpMap); - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_BumpMap = IN.ase_texcoord4.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float2 panner13 = ( 1.0 * _Time.y * _WaterSpeed + uv_BumpMap); - // *** BEGIN Flipbook UV Animation vars *** - // Total tiles of Flipbook Texture - float fbtotaltiles31 = 8.0 * 8.0; - // Offsets for cols and rows of Flipbook Texture - float fbcolsoffset31 = 1.0f / 8.0; - float fbrowsoffset31 = 1.0f / 8.0; - // Speed of animation - float fbspeed31 = _TimeParameters.x * _FrameRate; - // UV Tiling (col and row offset) - float2 fbtiling31 = float2(fbcolsoffset31, fbrowsoffset31); - // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset) - // Calculate current tile linear index - float fbcurrenttileindex31 = round( fmod( fbspeed31 + 0.0, fbtotaltiles31) ); - fbcurrenttileindex31 += ( fbcurrenttileindex31 < 0) ? fbtotaltiles31 : 0; - // Obtain Offset X coordinate from current tile linear index - float fblinearindextox31 = round ( fmod ( fbcurrenttileindex31, 8.0 ) ); - // Multiply Offset X by coloffset - float fboffsetx31 = fblinearindextox31 * fbcolsoffset31; - // Obtain Offset Y coordinate from current tile linear index - float fblinearindextoy31 = round( fmod( ( fbcurrenttileindex31 - fblinearindextox31 ) / 8.0, 8.0 ) ); - // Reverse Y to get tiles from Top to Bottom - fblinearindextoy31 = (int)(8.0-1) - fblinearindextoy31; - // Multiply Offset Y by rowoffset - float fboffsety31 = fblinearindextoy31 * fbrowsoffset31; - // UV Offset - float2 fboffset31 = float2(fboffsetx31, fboffsety31); - // Flipbook UV - half2 fbuv31 = frac( panner13 ) * fbtiling31 + fboffset31; - // *** END Flipbook UV Animation vars *** - float3 unpack29 = UnpackNormalScale( float4( UnpackNormalScale( SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, fbuv31 ), 1.0f ) , 0.0 ), _NormalScale ); - unpack29.z = lerp( 1, unpack29.z, saturate(_NormalScale) ); - - float3 Normal = unpack29; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - #define REQUIRE_DEPTH_TEXTURE 1 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_SCREEN_POSITION - #define ASE_NEEDS_FRAG_WORLD_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _BumpMap_ST; - float2 _WaterSpeed; - float _FogIntensity; - float _FrameRate; - float _NormalScale; - float _Metallic; - float _Smoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - uniform float4 _CameraDepthTexture_TexelSize; - TEXTURE2D(_BumpMap); - SAMPLER(sampler_BumpMap); - - - float2 UnStereo( float2 UV ) - { - #if UNITY_SINGLE_PASS_STEREO - float4 scaleOffset = unity_StereoScaleOffset[ unity_StereoEyeIndex ]; - UV.xy = (UV.xy - scaleOffset.zw) / scaleOffset.xy; - #endif - return UV; - } - - float3 InvertDepthDirURP75_g1( float3 In ) - { - float3 result = In; - #if !defined(ASE_SRP_VERSION) || ASE_SRP_VERSION <= 70301 || ASE_SRP_VERSION == 70503 || ASE_SRP_VERSION == 70600 || ASE_SRP_VERSION == 70700 || ASE_SRP_VERSION == 70701 || ASE_SRP_VERSION >= 80301 - result *= float3(1,1,-1); - #endif - return result; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float4 ase_screenPosNorm = ScreenPos / ScreenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float2 UV22_g3 = ase_screenPosNorm.xy; - float2 localUnStereo22_g3 = UnStereo( UV22_g3 ); - float2 break64_g1 = localUnStereo22_g3; - float clampDepth69_g1 = SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ); - #ifdef UNITY_REVERSED_Z - float staticSwitch38_g1 = ( 1.0 - clampDepth69_g1 ); - #else - float staticSwitch38_g1 = clampDepth69_g1; - #endif - float3 appendResult39_g1 = (float3(break64_g1.x , break64_g1.y , staticSwitch38_g1)); - float4 appendResult42_g1 = (float4((appendResult39_g1*2.0 + -1.0) , 1.0)); - float4 temp_output_43_0_g1 = mul( unity_CameraInvProjection, appendResult42_g1 ); - float3 temp_output_46_0_g1 = ( (temp_output_43_0_g1).xyz / (temp_output_43_0_g1).w ); - float3 In75_g1 = temp_output_46_0_g1; - float3 localInvertDepthDirURP75_g1 = InvertDepthDirURP75_g1( In75_g1 ); - float4 appendResult49_g1 = (float4(localInvertDepthDirURP75_g1 , 1.0)); - float saferPower180 = abs( ( _FogIntensity * -( distance( _WorldSpaceCameraPos , (mul( unity_CameraToWorld, appendResult49_g1 )).xyz ) - distance( _WorldSpaceCameraPos , WorldPosition ) ) ) ); - float temp_output_178_0 = exp2( pow( saferPower180 , 2.0 ) ); - float3 temp_cast_1 = (temp_output_178_0).xxx; - - float2 uv_BumpMap = IN.ase_texcoord8.xy * _BumpMap_ST.xy + _BumpMap_ST.zw; - float2 panner13 = ( 1.0 * _Time.y * _WaterSpeed + uv_BumpMap); - // *** BEGIN Flipbook UV Animation vars *** - // Total tiles of Flipbook Texture - float fbtotaltiles31 = 8.0 * 8.0; - // Offsets for cols and rows of Flipbook Texture - float fbcolsoffset31 = 1.0f / 8.0; - float fbrowsoffset31 = 1.0f / 8.0; - // Speed of animation - float fbspeed31 = _TimeParameters.x * _FrameRate; - // UV Tiling (col and row offset) - float2 fbtiling31 = float2(fbcolsoffset31, fbrowsoffset31); - // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset) - // Calculate current tile linear index - float fbcurrenttileindex31 = round( fmod( fbspeed31 + 0.0, fbtotaltiles31) ); - fbcurrenttileindex31 += ( fbcurrenttileindex31 < 0) ? fbtotaltiles31 : 0; - // Obtain Offset X coordinate from current tile linear index - float fblinearindextox31 = round ( fmod ( fbcurrenttileindex31, 8.0 ) ); - // Multiply Offset X by coloffset - float fboffsetx31 = fblinearindextox31 * fbcolsoffset31; - // Obtain Offset Y coordinate from current tile linear index - float fblinearindextoy31 = round( fmod( ( fbcurrenttileindex31 - fblinearindextox31 ) / 8.0, 8.0 ) ); - // Reverse Y to get tiles from Top to Bottom - fblinearindextoy31 = (int)(8.0-1) - fblinearindextoy31; - // Multiply Offset Y by rowoffset - float fboffsety31 = fblinearindextoy31 * fbrowsoffset31; - // UV Offset - float2 fboffset31 = float2(fboffsetx31, fboffsety31); - // Flipbook UV - half2 fbuv31 = frac( panner13 ) * fbtiling31 + fboffset31; - // *** END Flipbook UV Animation vars *** - float3 unpack29 = UnpackNormalScale( float4( UnpackNormalScale( SAMPLE_TEXTURE2D( _BumpMap, sampler_BumpMap, fbuv31 ), 1.0f ) , 0.0 ), _NormalScale ); - unpack29.z = lerp( 1, unpack29.z, saturate(_NormalScale) ); - - float3 temp_cast_3 = (temp_output_178_0).xxx; - - float3 Albedo = temp_cast_1; - float3 Normal = unpack29; - float3 Emission = temp_cast_3; - float3 Specular = 0.5; - float Metallic = _Metallic; - float Smoothness = _Smoothness; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); } - ENDHLSL } @@ -2554,17 +1389,15 @@ Shader "naelstrof/RunningWater" #define _NORMAL_DROPOFF_TS 1 #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2770,17 +1603,15 @@ Shader "naelstrof/RunningWater" #define _NORMAL_DROPOFF_TS 1 #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _EMISSION #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2987,8 +1818,7 @@ Shader "naelstrof/RunningWater" } /*ASEBEGIN -Version=18935 -86;376;1800;766;-1173.904;269.732;1.3;True;False +Version=19105 Node;AmplifyShaderEditor.CommentaryNode;109;-485.8487,-2071.056;Inherit;False;1573.748;550.8741;Fog;10;61;60;62;63;74;75;67;178;180;184;;1,1,1,1;0;0 Node;AmplifyShaderEditor.CommentaryNode;110;-431.6746,-1456.033;Inherit;False;1179.104;525.9291;ground color;6;103;97;101;96;77;94;;1,1,1,1;0;0 Node;AmplifyShaderEditor.SwizzleNode;186;-201.4965,-2559.682;Inherit;False;FLOAT3;0;1;2;3;1;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0 @@ -3038,7 +1868,7 @@ Node;AmplifyShaderEditor.LerpOp;104;1615.069,-401.54;Inherit;False;3;0;COLOR;0,0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;154;-151.1083,-702.5229;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0.5,0.5,0.5;False;1;FLOAT3;0 Node;AmplifyShaderEditor.RangedFloatNode;77;-150.6461,-1083.352;Inherit;False;Property;_Refraction;Refraction;9;0;Create;True;0;0;0;False;0;False;0.1;0.015;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.UnpackScaleNormalNode;29;-475.8248,190.9888;Inherit;False;Tangent;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 -Node;AmplifyShaderEditor.SamplerNode;12;-845.7069,226.8816;Inherit;True;Property;_BumpMap;BumpMap;0;0;Create;True;0;0;0;False;0;False;-1;None;c99e3b024b25a3d49bc9f43817625d98;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.SamplerNode;12;-845.7069,226.8816;Inherit;True;Property;_BumpMap;BumpMap;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;116;203.1566,-626.4316;Inherit;False;Property;_FresnelScale;FresnelScale;10;0;Create;True;0;0;0;False;0;False;1;1;0;5;0;1;FLOAT;0 Node;AmplifyShaderEditor.SaturateNode;159;1779.554,-189.134;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;16;-1961.937,-186.3806;Inherit;False;0;12;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 @@ -3053,16 +1883,16 @@ Node;AmplifyShaderEditor.SimpleMultiplyOpNode;169;-1051.153,-2457.17;Inherit;Fal Node;AmplifyShaderEditor.SimpleAddOpNode;183;-878.0216,-2324.709;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ScreenPosInputsNode;141;-2969.046,-2514.81;Float;False;0;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.StaticSwitch;131;-2102.5,-2447.737;Float;False;Property;_Keyword0;Keyword 0;3;0;Fetch;True;0;0;0;False;0;False;0;0;0;False;UNITY_REVERSED_Z;Toggle;2;Key0;Key1;Fetch;False;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;45;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;189;2033.166,164.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;2;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;49;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;50;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;2;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;190;2033.166,184.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;46;2033.166,104.3916;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;naelstrof/RunningWater;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;2;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;1;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;0;0; Use Shadow Threshold;0;0;Receive Shadows;0;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;True;True;True;True;True;False;;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;48;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;188;2033.166,164.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;47;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;191;2033.166,184.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;45;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;189;2033.166,164.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;49;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;50;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;190;2033.166,184.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;46;2033.166,104.3916;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;naelstrof/RunningWater;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;1;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;0; Use Shadow Threshold;0;0;Receive Shadows;0;0;GPU Instancing;0;638349116740622691;LOD CrossFade;0;638349116749052359;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;0;638349116778645088;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;False;False;True;False;True;True;False;;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;48;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;188;2033.166,164.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;47;593.6,-24.7;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;191;2033.166,184.3916;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;186;0;185;0 WireConnection;62;0;60;0 WireConnection;62;1;61;0 @@ -3130,4 +1960,4 @@ WireConnection;46;2;178;0 WireConnection;46;3;28;0 WireConnection;46;4;22;0 ASEEND*/ -//CHKSM=75378872DD8E9B756DEE9F24C4096BC8D2790699 \ No newline at end of file +//CHKSM=3FDC095E22C1C303B2DC1F6C341CC661A0588365 \ No newline at end of file diff --git a/Assets/KoboldKare/Shaders/StatueShader.shader b/Assets/KoboldKare/Shaders/StatueShader.shader deleted file mode 100644 index 549e3af3a..000000000 --- a/Assets/KoboldKare/Shaders/StatueShader.shader +++ /dev/null @@ -1,3019 +0,0 @@ -// Made with Amplify Shader Editor -// Available at the Unity Asset Store - http://u3d.as/y3X -Shader "StatueShader" -{ - Properties - { - [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 - [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) - [ASEBegin]_Albedo("Albedo", 2D) = "white" {} - _Normal("Normal", 2D) = "white" {} - _MaskMap("MaskMap", 2D) = "white" {} - _Thickness("Thickness", 2D) = "white" {} - [ASEEnd]_Color0("Color 0", Color) = (0,0,0,0) - [HideInInspector] _texcoord( "", 2D ) = "white" {} - - [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0 - [HideInInspector]_QueueControl("_QueueControl", Float) = -1 - [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} - _TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5 - _TransStrength( "Strength", Range( 0, 50 ) ) = 1 - _TransNormal( "Normal Distortion", Range( 0, 1 ) ) = 0.5 - _TransScattering( "Scattering", Range( 1, 50 ) ) = 2 - _TransDirect( "Direct", Range( 0, 1 ) ) = 0.9 - _TransAmbient( "Ambient", Range( 0, 1 ) ) = 0.1 - _TransShadow( "Shadow", Range( 0, 1 ) ) = 0.5 - //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5 - //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16 - //_TessMin( "Tess Min Distance", Float ) = 10 - //_TessMax( "Tess Max Distance", Float ) = 25 - //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16 - //_TessMaxDisp( "Tess Max Displacement", Float ) = 25 - } - - SubShader - { - LOD 0 - - - - Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" } - Cull Back - ZWrite On - ZTest LEqual - Offset 0 , 0 - AlphaToMask Off - - HLSLINCLUDE - #pragma target 3.0 - - #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x - - #ifndef ASE_TESS_FUNCS - #define ASE_TESS_FUNCS - float4 FixedTess( float tessValue ) - { - return tessValue; - } - - float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos ) - { - float3 wpos = mul(o2w,vertex).xyz; - float dist = distance (wpos, cameraPos); - float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess; - return f; - } - - float4 CalcTriEdgeTessFactors (float3 triVertexFactors) - { - float4 tess; - tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z); - tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z); - tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y); - tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f; - return tess; - } - - float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams ) - { - float dist = distance (0.5 * (wpos0+wpos1), cameraPos); - float len = distance(wpos0, wpos1); - float f = max(len * scParams.y / (edgeLen * dist), 1.0); - return f; - } - - float DistanceFromPlane (float3 pos, float4 plane) - { - float d = dot (float4(pos,1.0f), plane); - return d; - } - - bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] ) - { - float4 planeTest; - planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f ); - return !all (planeTest); - } - - float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos ) - { - float3 f; - f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos); - f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos); - f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos); - - return CalcTriEdgeTessFactors (f); - } - - float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - return tess; - } - - float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - - if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes)) - { - tess = 0.0f; - } - else - { - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - } - return tess; - } - #endif //ASE_TESS_FUNCS - - ENDHLSL - - - Pass - { - - Name "Forward" - Tags { "LightMode"="UniversalForward" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK - - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS - - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_FORWARD - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _Albedo; - sampler2D _Normal; - sampler2D _MaskMap; - sampler2D _Thickness; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - #if defined(LIGHTMAP_ON) - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - #if !defined(LIGHTMAP_ON) - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_Target - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 texCoord15 = IN.ase_texcoord8.xy * float2( 4,4 ) + float2( 0,0 ); - - float2 uv_Normal = IN.ase_texcoord8.xy * _Normal_ST.xy + _Normal_ST.zw; - - float2 uv_MaskMap = IN.ase_texcoord8.xy * _MaskMap_ST.xy + _MaskMap_ST.zw; - float4 tex2DNode3 = tex2D( _MaskMap, uv_MaskMap ); - - float2 uv_Thickness = IN.ase_texcoord8.xy * _Thickness_ST.xy + _Thickness_ST.zw; - - float3 Albedo = tex2D( _Albedo, texCoord15 ).rgb; - float3 Normal = UnpackNormalScale( tex2D( _Normal, uv_Normal ), 1.0f ); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = tex2DNode3.r; - float Smoothness = tex2DNode3.a; - float Occlusion = tex2DNode3.g; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = ( ( 1.0 - tex2D( _Thickness, uv_Thickness ).r ) * _Color0 ).rgb; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _CLEARCOAT - float CoatMask = 0; - float CoatSmoothness = 0; - #endif - - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.viewDirectionWS = WorldViewDirection; - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - #else - inputData.normalWS = WorldNormal; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - inputData.shadowCoord = ShadowCoords; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); - #else - inputData.shadowCoord = float4(0, 0, 0, 0); - #endif - - - #ifdef ASE_FOG - inputData.fogCoord = IN.fogFactorAndVertexLight.x; - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - SurfaceData surfaceData; - surfaceData.albedo = Albedo; - surfaceData.metallic = saturate(Metallic); - surfaceData.specular = Specular; - surfaceData.smoothness = saturate(Smoothness), - surfaceData.occlusion = Occlusion, - surfaceData.emission = Emission, - surfaceData.alpha = saturate(Alpha); - surfaceData.normalTS = Normal; - surfaceData.clearCoatMask = 0; - surfaceData.clearCoatSmoothness = 1; - - - #ifdef _CLEARCOAT - surfaceData.clearCoatMask = saturate(CoatMask); - surfaceData.clearCoatSmoothness = saturate(CoatSmoothness); - #endif - - #ifdef _DBUFFER - ApplyDecalToSurfaceData(IN.clipPos, surfaceData, inputData); - #endif - - half4 color = UniversalFragmentPBR( inputData, surfaceData); - - #ifdef _TRANSMISSION_ASE - { - float shadow = _TransmissionShadow; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission; - color.rgb += Albedo * mainTransmission; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission; - color.rgb += Albedo * transmission; - } - #endif - } - #endif - - #ifdef _TRANSLUCENCY_ASE - { - float shadow = _TransShadow; - float normal = _TransNormal; - float scattering = _TransScattering; - float direct = _TransDirect; - float ambient = _TransAmbient; - float strength = _TransStrength; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - - half3 mainLightDir = mainLight.direction + inputData.normalWS * normal; - half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering ); - half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * mainTranslucency * strength; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 lightDir = light.direction + inputData.normalWS * normal; - half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering ); - half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * translucency * strength; - } - #endif - } - #endif - - #ifdef _REFRACTION_ASE - float4 projScreenPos = ScreenPos / ScreenPos.w; - float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) ); - projScreenPos.xy += refractionOffset.xy; - float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor; - color.rgb = lerp( refraction, color.rgb, color.a ); - color.a = 1; - #endif - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return color; - } - - ENDHLSL - } - - - Pass - { - - Name "ShadowCaster" - Tags { "LightMode"="ShadowCaster" } - - ZWrite On - ZTest LEqual - AlphaToMask Off - ColorMask 0 - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW - - #define SHADERPASS SHADERPASS_SHADOWCASTER - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - float3 _LightDirection; - float3 _LightPosition; - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - float3 normalWS = TransformObjectToWorldDir(v.ase_normal); - - - #if _CASTING_PUNCTUAL_LIGHT_SHADOW - float3 lightDirectionWS = normalize(_LightPosition - positionWS); - #else - float3 lightDirectionWS = _LightDirection; - #endif - - float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); - - #if UNITY_REVERSED_Z - clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #else - clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #endif - - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = clipPos; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - #ifdef _ALPHATEST_SHADOW_ON - clip(Alpha - AlphaClipThresholdShadow); - #else - clip(Alpha - AlphaClipThreshold); - #endif - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - return 0; - } - - ENDHLSL - } - - - Pass - { - - Name "DepthOnly" - Tags { "LightMode"="DepthOnly" } - - ZWrite On - ColorMask 0 - AlphaToMask Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return 0; - } - ENDHLSL - } - - - Pass - { - - Name "Meta" - Tags { "LightMode"="Meta" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _Albedo; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.texcoord0.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 texCoord15 = IN.ase_texcoord4.xy * float2( 4,4 ) + float2( 0,0 ); - - - float3 Albedo = tex2D( _Albedo, texCoord15 ).rgb; - float3 Emission = 0; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif - - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _Albedo; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - o.ase_texcoord2.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.zw = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 texCoord15 = IN.ase_texcoord2.xy * float2( 4,4 ) + float2( 0,0 ); - - - float3 Albedo = tex2D( _Albedo, texCoord15 ).rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _Normal; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_Normal = IN.ase_texcoord4.xy * _Normal_ST.xy + _Normal_ST.zw; - - float3 Normal = UnpackNormalScale( tex2D( _Normal, uv_Normal ), 1.0f ); - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _Albedo; - sampler2D _Normal; - sampler2D _MaskMap; - sampler2D _Thickness; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 texCoord15 = IN.ase_texcoord8.xy * float2( 4,4 ) + float2( 0,0 ); - - float2 uv_Normal = IN.ase_texcoord8.xy * _Normal_ST.xy + _Normal_ST.zw; - - float2 uv_MaskMap = IN.ase_texcoord8.xy * _MaskMap_ST.xy + _MaskMap_ST.zw; - float4 tex2DNode3 = tex2D( _MaskMap, uv_MaskMap ); - - float2 uv_Thickness = IN.ase_texcoord8.xy * _Thickness_ST.xy + _Thickness_ST.zw; - - float3 Albedo = tex2D( _Albedo, texCoord15 ).rgb; - float3 Normal = UnpackNormalScale( tex2D( _Normal, uv_Normal ), 1.0f ); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = tex2DNode3.r; - float Smoothness = tex2DNode3.a; - float Occlusion = tex2DNode3.g; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = ( ( 1.0 - tex2D( _Thickness, uv_Thickness ).r ) * _Color0 ).rgb; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - - Pass - { - - Name "SceneSelectionPass" - Tags { "LightMode"="SceneSelectionPass" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - int _ObjectId; - int _PassValue; - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); - return outColor; - } - - ENDHLSL - } - - - Pass - { - - Name "ScenePickingPass" - Tags { "LightMode"="Picking" } - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #define _TRANSMISSION_ASE 1 - #define _TRANSLUCENCY_ASE 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Normal_ST; - float4 _MaskMap_ST; - float4 _Thickness_ST; - float4 _Color0; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - - float4 _SelectionID; - - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = 0; - outColor = _SelectionID; - - return outColor; - } - - ENDHLSL - } - - } - - CustomEditor "UnityEditor.ShaderGraphLitGUI" - Fallback "Hidden/InternalErrorShader" - -} -/*ASEBEGIN -Version=18935 -188;366;1800;766;1041.806;274.6002;1.70346;True;False -Node;AmplifyShaderEditor.SamplerNode;5;77.47673,566.6321;Inherit;True;Property;_Thickness;Thickness;3;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.TextureCoordinatesNode;15;-252.2514,-103.4027;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;4,4;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.OneMinusNode;14;432.3769,452.2321;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 -Node;AmplifyShaderEditor.ColorNode;12;418.0766,579.6317;Inherit;False;Property;_Color0;Color 0;4;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.SamplerNode;2;83.97691,116.8322;Inherit;True;Property;_Normal;Normal;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.SamplerNode;3;74.87692,352.1322;Inherit;True;Property;_MaskMap;MaskMap;2;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.SimpleMultiplyOpNode;13;624.7766,530.2322;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 -Node;AmplifyShaderEditor.SamplerNode;1;79.88731,-144.3186;Inherit;True;Property;_Albedo;Albedo;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;17;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;415.9999,44.4;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;415.9999,-15.6;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;StatueShader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;1;0; Transmission Shadow;0.5,False,-1;0;Translucency;1;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;11;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;9;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;8;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;18;415.9999,64.4;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;10;415.9999,-15.6;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;19;415.9999,64.4;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -WireConnection;14;0;5;1 -WireConnection;13;0;14;0 -WireConnection;13;1;12;0 -WireConnection;1;1;15;0 -WireConnection;7;0;1;0 -WireConnection;7;1;2;0 -WireConnection;7;3;3;1 -WireConnection;7;4;3;4 -WireConnection;7;5;3;2 -WireConnection;7;15;13;0 -ASEEND*/ -//CHKSM=29D3859DC1051DFF8D8D85ED42FA7F840A31A8FA \ No newline at end of file diff --git a/Assets/KoboldKare/Shaders/StatueShader.shader.meta b/Assets/KoboldKare/Shaders/StatueShader.shader.meta deleted file mode 100644 index 898d369c3..000000000 --- a/Assets/KoboldKare/Shaders/StatueShader.shader.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: def7000896e247349bf958c5d2a9a6f2 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - preprocessorOverride: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Shaders/TerrainBrushedDecalable.shader b/Assets/KoboldKare/Shaders/TerrainBrushedDecalable.shader index 0316c2eb5..7999c8393 100644 --- a/Assets/KoboldKare/Shaders/TerrainBrushedDecalable.shader +++ b/Assets/KoboldKare/Shaders/TerrainBrushedDecalable.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "TerrainBrush/TerrainBrushedDecalable" { @@ -60,7 +60,7 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -184,7 +184,7 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -773,7 +773,7 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -1057,7 +1057,7 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -1311,14 +1311,14 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION + #pragma shader_feature_local _ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1614,298 +1614,6 @@ Shader "TerrainBrush/TerrainBrushedDecalable" } - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend Off - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _CLEARCOAT 1 - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 - #define ASE_USING_SAMPLING_MACROS 1 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _ColorBDark; - float4 _ColorBLight; - float4 _ColorADark; - float4 _ColorALight; - float _Tiling; - float _HeightBlendSmoothing; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - TEXTURE2D(_BaseColorMapB); - SAMPLER(sampler_BaseColorMapB); - TEXTURE2D(_BaseColorMapA); - SAMPLER(sampler_BaseColorMapA); - TEXTURE2D(_TerrainBlendMap); - SAMPLER(sampler_TerrainBlendMap); - TEXTURE2D(_Height); - SAMPLER(sampler_Height); - TEXTURE2D(_HeightB); - SAMPLER(sampler_HeightB); - TEXTURE2D(_DecalColorMap); - SAMPLER(sampler_DecalColorMap); - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord4.xyz = ase_worldNormal; - - o.ase_texcoord2 = v.vertex; - o.ase_texcoord3.xy = v.ase_texcoord.xy; - o.ase_texcoord3.zw = v.ase_texcoord1.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.w = 0; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; - float4 ase_texcoord1 : TEXCOORD1; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; - o.ase_texcoord1 = v.ase_texcoord1; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float4 appendResult3_g31 = (float4(IN.ase_texcoord2.xyz , 1.0)); - float4 transform4_g31 = mul(GetObjectToWorldMatrix(),appendResult3_g31); - float2 appendResult6_g31 = (float2(transform4_g31.x , transform4_g31.z)); - float2 WorldUV9_g31 = ( appendResult6_g31 * _Tiling ); - float4 tex2DNode18_g31 = SAMPLE_TEXTURE2D( _BaseColorMapB, sampler_BaseColorMapB, WorldUV9_g31 ); - float4 lerpResult24_g31 = lerp( _ColorBDark , _ColorBLight , tex2DNode18_g31.r); - float4 tex2DNode14_g31 = SAMPLE_TEXTURE2D( _BaseColorMapA, sampler_BaseColorMapA, WorldUV9_g31 ); - float4 lerpResult25_g31 = lerp( _ColorADark , _ColorALight , tex2DNode14_g31.r); - float2 texCoord48_g31 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 ); - float temp_output_13_0_g32 = ( 1.0 / _HeightBlendSmoothing ); - float temp_output_36_0_g31 = saturate( ( ( ( SAMPLE_TEXTURE2D( _TerrainBlendMap, sampler_TerrainBlendMap, texCoord48_g31 ).r * ( temp_output_13_0_g32 + 1.0 ) ) + ( ( SAMPLE_TEXTURE2D( _Height, sampler_Height, WorldUV9_g31 ).r * temp_output_13_0_g32 * 4.0 ) - temp_output_13_0_g32 ) ) + -( SAMPLE_TEXTURE2D( _HeightB, sampler_HeightB, WorldUV9_g31 ).r * temp_output_13_0_g32 ) ) ); - float4 lerpResult37_g31 = lerp( ( lerpResult24_g31 * tex2DNode18_g31.g ) , ( lerpResult25_g31 * tex2DNode14_g31.g ) , temp_output_36_0_g31); - float2 texCoord2_g6 = IN.ase_texcoord3.zw * float2( 1,1 ) + float2( 0,0 ); - float4 tex2DNode3_g6 = SAMPLE_TEXTURE2D_LOD( _DecalColorMap, sampler_DecalColorMap, texCoord2_g6, 0.0 ); - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float3 ase_worldNormal = IN.ase_texcoord4.xyz; - float fresnelNdotV16_g6 = dot( ase_worldNormal, ase_worldViewDir ); - float fresnelNode16_g6 = ( 0.6 + 1.0 * pow( max( 1.0 - fresnelNdotV16_g6 , 0.0001 ), 2.0 ) ); - float4 lerpResult7_g6 = lerp( lerpResult37_g31 , tex2DNode3_g6 , saturate( ( tex2DNode3_g6.a * fresnelNode16_g6 ) )); - - - float3 Albedo = lerpResult7_g6.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - Pass { @@ -1924,7 +1632,7 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 @@ -2237,11 +1945,11 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2449,11 +2157,11 @@ Shader "TerrainBrush/TerrainBrushedDecalable" #define ASE_FOG 1 #define _CLEARCOAT 1 #define _NORMALMAP 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #define ASE_USING_SAMPLING_MACROS 1 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -2659,21 +2367,20 @@ Shader "TerrainBrush/TerrainBrushedDecalable" } /*ASEBEGIN -Version=18935 -208;485;1855;833;-1689.241;218.5923;1;True;False +Version=19105 Node;AmplifyShaderEditor.BreakToComponentsNode;137;2394.67,233.2173;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15 Node;AmplifyShaderEditor.FunctionNode;138;2093.958,-19.85583;Inherit;False;ApplyDecals;16;;6;d9b89e1202461fa45af2324780068fb2;0;3;4;COLOR;0,0,0,0;False;5;FLOAT3;0,0,0;False;6;COLOR;0,0,0,0;False;5;FLOAT;18;FLOAT;20;FLOAT3;14;FLOAT4;15;COLOR;13 Node;AmplifyShaderEditor.FunctionNode;164;1700.67,57.21732;Inherit;False;TerrainPlanarProjection;0;;31;7f77f62b983d6b14cae371e33a438508;0;1;47;FLOAT2;0,0;False;3;COLOR;0;FLOAT3;44;COLOR;45 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;145;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;146;2654.059,69.05953;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;TerrainBrush/TerrainBrushedDecalable;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;True;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637940376532726118;LOD CrossFade;0;637940371782245640;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975009079273343;0;10;False;True;True;True;True;True;True;False;True;True;False;;True;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;147;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;148;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;149;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;150;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;151;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormalsOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;152;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;153;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;154;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;145;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;146;2654.059,69.05953;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;TerrainBrush/TerrainBrushedDecalable;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;True;True;0;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;637940376532726118;LOD CrossFade;0;637940371782245640;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;1;637975009079273343;0;10;False;True;True;True;True;False;True;False;True;True;False;;True;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;147;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;148;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;149;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;150;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;151;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;152;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;0;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;153;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;154;2654.059,69.05953;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;137;0;138;15 WireConnection;138;4;164;0 WireConnection;138;5;164;44 @@ -2684,4 +2391,4 @@ WireConnection;146;4;137;3 WireConnection;146;18;138;20 WireConnection;146;19;138;18 ASEEND*/ -//CHKSM=17015E7BBC7CC5D285F216609B26F149E7480EEB \ No newline at end of file +//CHKSM=9C847CCECE3A269A56BE67ABCC4F5FE2A562773D diff --git a/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader b/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader deleted file mode 100644 index fc7640251..000000000 --- a/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader +++ /dev/null @@ -1,3249 +0,0 @@ -// Made with Amplify Shader Editor -// Available at the Unity Asset Store - http://u3d.as/y3X -Shader "Hidden/Mtree/SRP/VertexColorShader URP" -{ - Properties - { - [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 - [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) - [ASEBegin][Header(Wind)]_GlobalWindInfluence("Global Wind Influence", Range( 0 , 1)) = 1 - [ASEEnd][Enum(Off,0,Front,1,Back,2)]_CullMode("Cull Mode", Int) = 2 - - [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0 - [HideInInspector]_QueueControl("_QueueControl", Float) = -1 - [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} - [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} - //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5 - //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1 - //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5 - //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2 - //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9 - //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1 - //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5 - //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5 - //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16 - //_TessMin( "Tess Min Distance", Float ) = 10 - //_TessMax( "Tess Max Distance", Float ) = 25 - //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16 - //_TessMaxDisp( "Tess Max Displacement", Float ) = 25 - } - - SubShader - { - LOD 0 - - - - Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" } - Cull [_CullMode] - ZWrite On - ZTest LEqual - Offset 0 , 0 - AlphaToMask Off - - HLSLINCLUDE - #pragma target 3.0 - - #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x - - #ifndef ASE_TESS_FUNCS - #define ASE_TESS_FUNCS - float4 FixedTess( float tessValue ) - { - return tessValue; - } - - float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos ) - { - float3 wpos = mul(o2w,vertex).xyz; - float dist = distance (wpos, cameraPos); - float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess; - return f; - } - - float4 CalcTriEdgeTessFactors (float3 triVertexFactors) - { - float4 tess; - tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z); - tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z); - tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y); - tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f; - return tess; - } - - float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams ) - { - float dist = distance (0.5 * (wpos0+wpos1), cameraPos); - float len = distance(wpos0, wpos1); - float f = max(len * scParams.y / (edgeLen * dist), 1.0); - return f; - } - - float DistanceFromPlane (float3 pos, float4 plane) - { - float d = dot (float4(pos,1.0f), plane); - return d; - } - - bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] ) - { - float4 planeTest; - planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f ); - planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + - (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f ); - return !all (planeTest); - } - - float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos ) - { - float3 f; - f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos); - f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos); - f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos); - - return CalcTriEdgeTessFactors (f); - } - - float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - return tess; - } - - float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] ) - { - float3 pos0 = mul(o2w,v0).xyz; - float3 pos1 = mul(o2w,v1).xyz; - float3 pos2 = mul(o2w,v2).xyz; - float4 tess; - - if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes)) - { - tess = 0.0f; - } - else - { - tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); - tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); - tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); - tess.w = (tess.x + tess.y + tess.z) / 3.0f; - } - return tess; - } - #endif //ASE_TESS_FUNCS - - ENDHLSL - - - Pass - { - - Name "Forward" - Tags { "LightMode"="UniversalForward" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK - - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS - - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_FORWARD - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - o.ase_color = v.ase_color; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - #if defined(LIGHTMAP_ON) - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - #if !defined(LIGHTMAP_ON) - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_Target - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - - float3 Albedo = IN.ase_color.rgb; - float3 Normal = float3(0, 0, 1); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = 0; - float Smoothness = 0.5; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _CLEARCOAT - float CoatMask = 0; - float CoatSmoothness = 0; - #endif - - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.viewDirectionWS = WorldViewDirection; - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - #else - inputData.normalWS = WorldNormal; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - inputData.shadowCoord = ShadowCoords; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); - #else - inputData.shadowCoord = float4(0, 0, 0, 0); - #endif - - - #ifdef ASE_FOG - inputData.fogCoord = IN.fogFactorAndVertexLight.x; - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - SurfaceData surfaceData; - surfaceData.albedo = Albedo; - surfaceData.metallic = saturate(Metallic); - surfaceData.specular = Specular; - surfaceData.smoothness = saturate(Smoothness), - surfaceData.occlusion = Occlusion, - surfaceData.emission = Emission, - surfaceData.alpha = saturate(Alpha); - surfaceData.normalTS = Normal; - surfaceData.clearCoatMask = 0; - surfaceData.clearCoatSmoothness = 1; - - - #ifdef _CLEARCOAT - surfaceData.clearCoatMask = saturate(CoatMask); - surfaceData.clearCoatSmoothness = saturate(CoatSmoothness); - #endif - - #ifdef _DBUFFER - ApplyDecalToSurfaceData(IN.clipPos, surfaceData, inputData); - #endif - - half4 color = UniversalFragmentPBR( inputData, surfaceData); - - #ifdef _TRANSMISSION_ASE - { - float shadow = _TransmissionShadow; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission; - color.rgb += Albedo * mainTransmission; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission; - color.rgb += Albedo * transmission; - } - #endif - } - #endif - - #ifdef _TRANSLUCENCY_ASE - { - float shadow = _TransShadow; - float normal = _TransNormal; - float scattering = _TransScattering; - float direct = _TransDirect; - float ambient = _TransAmbient; - float strength = _TransStrength; - - Light mainLight = GetMainLight( inputData.shadowCoord ); - float3 mainAtten = mainLight.color * mainLight.distanceAttenuation; - mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow ); - - half3 mainLightDir = mainLight.direction + inputData.normalWS * normal; - half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering ); - half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * mainTranslucency * strength; - - #ifdef _ADDITIONAL_LIGHTS - int transPixelLightCount = GetAdditionalLightsCount(); - for (int i = 0; i < transPixelLightCount; ++i) - { - Light light = GetAdditionalLight(i, inputData.positionWS); - float3 atten = light.color * light.distanceAttenuation; - atten = lerp( atten, atten * light.shadowAttenuation, shadow ); - - half3 lightDir = light.direction + inputData.normalWS * normal; - half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering ); - half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency; - color.rgb += Albedo * translucency * strength; - } - #endif - } - #endif - - #ifdef _REFRACTION_ASE - float4 projScreenPos = ScreenPos / ScreenPos.w; - float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) ); - projScreenPos.xy += refractionOffset.xy; - float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor; - color.rgb = lerp( refraction, color.rgb, color.a ); - color.a = 1; - #endif - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return color; - } - - ENDHLSL - } - - - Pass - { - - Name "ShadowCaster" - Tags { "LightMode"="ShadowCaster" } - - ZWrite On - ZTest LEqual - AlphaToMask Off - ColorMask 0 - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW - - #define SHADERPASS SHADERPASS_SHADOWCASTER - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - float3 _LightDirection; - float3 _LightPosition; - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - float3 normalWS = TransformObjectToWorldDir(v.ase_normal); - - - #if _CASTING_PUNCTUAL_LIGHT_SHADOW - float3 lightDirectionWS = normalize(_LightPosition - positionWS); - #else - float3 lightDirectionWS = _LightDirection; - #endif - - float4 clipPos = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); - - #if UNITY_REVERSED_Z - clipPos.z = min(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #else - clipPos.z = max(clipPos.z, UNITY_NEAR_CLIP_VALUE); - #endif - - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = clipPos; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - #ifdef _ALPHATEST_SHADOW_ON - clip(Alpha - AlphaClipThresholdShadow); - #else - clip(Alpha - AlphaClipThreshold); - #endif - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - return 0; - } - - ENDHLSL - } - - - Pass - { - - Name "DepthOnly" - Tags { "LightMode"="DepthOnly" } - - ZWrite On - ColorMask 0 - AlphaToMask Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return 0; - } - ENDHLSL - } - - - Pass - { - - Name "Meta" - Tags { "LightMode"="Meta" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #pragma shader_feature _ EDITOR_VISUALIZATION - - #define SHADERPASS SHADERPASS_META - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - #ifdef EDITOR_VISUALIZATION - float4 VizUV : TEXCOORD2; - float4 LightCoord : TEXCOORD3; - #endif - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - o.ase_color = v.ase_color; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); - - #ifdef EDITOR_VISUALIZATION - float2 VizUV = 0; - float4 LightCoord = 0; - UnityEditorVizData(v.vertex.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord); - o.VizUV = float4(VizUV, 0, 0); - o.LightCoord = LightCoord; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = o.clipPos; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 texcoord0 : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.texcoord0 = v.texcoord0; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - - float3 Albedo = IN.ase_color.rgb; - float3 Emission = 0; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - MetaInput metaInput = (MetaInput)0; - metaInput.Albedo = Albedo; - metaInput.Emission = Emission; - #ifdef EDITOR_VISUALIZATION - metaInput.VizUV = IN.VizUV.xy; - metaInput.LightCoord = IN.LightCoord; - #endif - - return MetaFragment(metaInput); - } - ENDHLSL - } - - - Pass - { - - Name "Universal2D" - Tags { "LightMode"="Universal2D" } - - Blend One Zero, One Zero - ColorMask RGBA - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - o.ase_color = v.ase_color; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID( IN ); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - - float3 Albedo = IN.ase_color.rgb; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float3 Normal = float3(0, 0, 1); - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_VERT_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_color : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - float _WindStrength; - float _RandomWindOffset; - float _WindPulse; - float _WindDirection; - - - float2 DirectionalEquation( float _WindDirection ) - { - float d = _WindDirection * 0.0174532924; - float xL = cos(d) + 1 / 2; - float zL = sin(d) + 1 / 2; - return float2(zL,xL); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - float3 VAR_VertexPosition21_g2 = mul( GetObjectToWorldMatrix(), float4( v.vertex.xyz , 0.0 ) ).xyz; - float3 break109_g2 = VAR_VertexPosition21_g2; - float VAR_WindStrength43_g2 = ( _WindStrength * _GlobalWindInfluence ); - float4 transform37_g2 = mul(GetObjectToWorldMatrix(),float4( 0,0,0,1 )); - float2 appendResult38_g2 = (float2(transform37_g2.x , transform37_g2.z)); - float dotResult2_g3 = dot( appendResult38_g2 , float2( 12.9898,78.233 ) ); - float lerpResult8_g3 = lerp( 0.8 , ( ( _RandomWindOffset / 2.0 ) + 0.9 ) , frac( ( sin( dotResult2_g3 ) * 43758.55 ) )); - float VAR_RandomTime16_g2 = ( ( _TimeParameters.x * 0.05 ) * lerpResult8_g3 ); - float FUNC_Turbulence36_g2 = ( sin( ( ( VAR_RandomTime16_g2 * 40.0 ) - ( VAR_VertexPosition21_g2.z / 15.0 ) ) ) * 0.5 ); - float VAR_WindPulse274_g2 = _WindPulse; - float FUNC_Angle73_g2 = ( VAR_WindStrength43_g2 * ( 1.0 + sin( ( ( ( ( VAR_RandomTime16_g2 * 2.0 ) + FUNC_Turbulence36_g2 ) - ( VAR_VertexPosition21_g2.z / 50.0 ) ) - ( v.ase_color.r / 20.0 ) ) ) ) * sqrt( v.ase_color.r ) * 0.2 * VAR_WindPulse274_g2 ); - float VAR_SinA80_g2 = sin( FUNC_Angle73_g2 ); - float VAR_CosA78_g2 = cos( FUNC_Angle73_g2 ); - float _WindDirection164_g2 = _WindDirection; - float2 localDirectionalEquation164_g2 = DirectionalEquation( _WindDirection164_g2 ); - float2 break165_g2 = localDirectionalEquation164_g2; - float VAR_xLerp83_g2 = break165_g2.x; - float lerpResult118_g2 = lerp( break109_g2.x , ( ( break109_g2.y * VAR_SinA80_g2 ) + ( break109_g2.x * VAR_CosA78_g2 ) ) , VAR_xLerp83_g2); - float3 break98_g2 = VAR_VertexPosition21_g2; - float3 break105_g2 = VAR_VertexPosition21_g2; - float VAR_zLerp95_g2 = break165_g2.y; - float lerpResult120_g2 = lerp( break105_g2.z , ( ( break105_g2.y * VAR_SinA80_g2 ) + ( break105_g2.z * VAR_CosA78_g2 ) ) , VAR_zLerp95_g2); - float3 appendResult122_g2 = (float3(lerpResult118_g2 , ( ( break98_g2.y * VAR_CosA78_g2 ) - ( break98_g2.z * VAR_SinA80_g2 ) ) , lerpResult120_g2)); - float3 FUNC_vertexPos123_g2 = appendResult122_g2; - float3 break221_g2 = FUNC_vertexPos123_g2; - half FUNC_SinFunction195_g2 = sin( ( ( VAR_RandomTime16_g2 * 200.0 * ( 0.2 + v.ase_color.g ) ) + ( v.ase_color.g * 10.0 ) + FUNC_Turbulence36_g2 + ( VAR_VertexPosition21_g2.z / 2.0 ) ) ); - float temp_output_202_0_g2 = ( FUNC_SinFunction195_g2 * v.ase_color.b * ( FUNC_Angle73_g2 + ( VAR_WindStrength43_g2 / 200.0 ) ) ); - float lerpResult203_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_xLerp83_g2); - float lerpResult196_g2 = lerp( 0.0 , temp_output_202_0_g2 , VAR_zLerp95_g2); - float3 appendResult197_g2 = (float3(( break221_g2.x + lerpResult203_g2 ) , break221_g2.y , ( break221_g2.z + lerpResult196_g2 ))); - float3 OUT_Grass_Standalone245_g2 = appendResult197_g2; - float3 temp_output_5_0_g2 = mul( GetWorldToObjectMatrix(), float4( OUT_Grass_Standalone245_g2 , 0.0 ) ).xyz; - - o.ase_color = v.ase_color; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = temp_output_5_0_g2; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - float4 ase_color : COLOR; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - o.ase_color = v.ase_color; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - - float3 Albedo = IN.ase_color.rgb; - float3 Normal = float3(0, 0, 1); - float3 Emission = 0; - float3 Specular = 0.5; - float Metallic = 0; - float Smoothness = 0.5; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); - } - - ENDHLSL - } - - - Pass - { - - Name "SceneSelectionPass" - Tags { "LightMode"="SceneSelectionPass" } - - Cull Off - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - int _ObjectId; - int _PassValue; - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); - return outColor; - } - - ENDHLSL - } - - - Pass - { - - Name "ScenePickingPass" - Tags { "LightMode"="Picking" } - - HLSLPROGRAM - - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_instancing - #pragma multi_compile _ LOD_FADE_CROSSFADE - #pragma multi_compile_fog - #define ASE_FOG 1 - #define ASE_ABSOLUTE_VERTEX_POS 1 - #define ASE_SRP_VERSION 999999 - - - #pragma only_renderers d3d11 glcore gles gles3 - #pragma vertex vert - #pragma fragment frag - - - #define ATTRIBUTES_NEED_NORMAL - #define ATTRIBUTES_NEED_TANGENT - #define SHADERPASS SHADERPASS_DEPTHONLY - - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - int _CullMode; - float _GlobalWindInfluence; - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - - - float4 _SelectionID; - - - struct SurfaceDescription - { - float Alpha; - float AlphaClipThreshold; - }; - - VertexOutput VertexFunction(VertexInput v ) - { - VertexOutput o; - ZERO_INITIALIZE(VertexOutput, o); - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - o.clipPos = TransformWorldToHClip(positionWS); - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - half4 frag(VertexOutput IN ) : SV_TARGET - { - SurfaceDescription surfaceDescription = (SurfaceDescription)0; - - surfaceDescription.Alpha = 1; - surfaceDescription.AlphaClipThreshold = 0.5; - - - #if _ALPHATEST_ON - float alphaClipThreshold = 0.01f; - #if ALPHA_CLIP_THRESHOLD - alphaClipThreshold = surfaceDescription.AlphaClipThreshold; - #endif - clip(surfaceDescription.Alpha - alphaClipThreshold); - #endif - - half4 outColor = 0; - outColor = _SelectionID; - - return outColor; - } - - ENDHLSL - } - - } - - CustomEditor "UnityEditor.ShaderGraphLitGUI" - Fallback "Hidden/InternalErrorShader" - -} -/*ASEBEGIN -Version=18935 -86;376;1800;766;1952.175;533.5552;1.630142;True;False -Node;AmplifyShaderEditor.CommentaryNode;22;-976.9675,61.41877;Inherit;False;275.1868;247.6812;;1;19;Vertex Position;0,1,0.09019608,1;0;0 -Node;AmplifyShaderEditor.CommentaryNode;24;-1409.197,-326.6083;Inherit;False;674.4768;271.9942;;1;1;Albedo;1,0.1254902,0.1254902,1;0;0 -Node;AmplifyShaderEditor.CommentaryNode;23;-1397.893,68.09306;Inherit;False;275;165;;1;17;Variables;1,0,0.7254902,1;0;0 -Node;AmplifyShaderEditor.IntNode;17;-1372.171,118.5078;Inherit;False;Property;_CullMode;Cull Mode;9;1;[Enum];Create;True;0;3;Off;0;Front;1;Back;2;0;True;0;False;2;0;False;0;1;INT;0 -Node;AmplifyShaderEditor.VertexColorNode;1;-1338.694,-258.3241;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 -Node;AmplifyShaderEditor.FunctionNode;19;-925.9949,163.2096;Inherit;False;Mtree Wind;0;;2;2ffbceb0d88c2164eb1d1c7b2010084d;7,269,1,281,0,272,0,255,4,278,0,280,0,282,0;0;1;FLOAT3;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;38;-284.9035,-198.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;37;-284.9035,-198.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;36;-284.9035,-258.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;35;-284.9035,-258.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;33;-284.9035,-258.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;39;-284.9035,-178.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;32;-284.9035,-258.0691;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;Hidden/Mtree/SRP/VertexColorShader URP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;True;17;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;1;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;0;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;31;-284.9035,-258.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;34;-284.9035,-258.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;40;-284.9035,-178.0691;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.CommentaryNode;25;-334.9035,-308.0691;Inherit;False;313;505;;0;Output;0,0,0,1;0;0 -WireConnection;32;0;1;0 -WireConnection;32;8;19;0 -ASEEND*/ -//CHKSM=910FBE74168853EC8866487E81B10A33F1EDD517 \ No newline at end of file diff --git a/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader.meta b/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader.meta deleted file mode 100644 index 549931e58..000000000 --- a/Assets/KoboldKare/Shaders/Vertex Color Shader URP.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: eba94a0fd199cff409ad99d5220fda87 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/KoboldKare/Shaders/WaterSample.shader b/Assets/KoboldKare/Shaders/WaterSample.shader index 0be539faf..858ef383a 100644 --- a/Assets/KoboldKare/Shaders/WaterSample.shader +++ b/Assets/KoboldKare/Shaders/WaterSample.shader @@ -190,27 +190,27 @@ Shader "ASESampleShaders/Water/WaterSample" #define REQUIRE_OPAQUE_TEXTURE 1 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -1101,7 +1101,7 @@ Shader "ASESampleShaders/Water/WaterSample" #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1456,11 +1456,13 @@ Shader "ASESampleShaders/Water/WaterSample" Pass { - Name "Universal2D" - Tags { "LightMode"="Universal2D" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha - ColorMask RGBA + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM @@ -1471,29 +1473,25 @@ Shader "ASESampleShaders/Water/WaterSample" #define _EMISSION #define _NORMALMAP 1 #define ASE_SRP_VERSION 120110 - #define REQUIRE_DEPTH_TEXTURE 1 - #define REQUIRE_OPAQUE_TEXTURE 1 #pragma vertex vert #pragma fragment frag - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + struct VertexInput { float4 vertex : POSITION; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -1507,8 +1505,9 @@ Shader "ASESampleShaders/Water/WaterSample" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + float4 ase_texcoord4 : TEXCOORD4; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -1550,41 +1549,21 @@ Shader "ASESampleShaders/Water/WaterSample" float _TessMaxDisp; #endif CBUFFER_END - uniform float4 _CameraDepthTexture_TexelSize; - sampler2D _Foam; sampler2D _WaterNormal; - inline float4 ASE_ComputeGrabScreenPos( float4 pos ) - { - #if UNITY_UV_STARTS_AT_TOP - float scale = -1.0; - #else - float scale = 1.0; - #endif - float4 o = pos; - o.y = pos.w * 0.5f; - o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; - return o; - } - VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - float4 ase_clipPos = TransformObjectToHClip((v.vertex).xyz); - float4 screenPos = ComputeScreenPos(ase_clipPos); - o.ase_texcoord2 = screenPos; - - o.ase_texcoord3.xy = v.ase_texcoord.xy; + o.ase_texcoord4.xy = v.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord3.zw = 0; - + o.ase_texcoord4.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else @@ -1598,21 +1577,24 @@ Shader "ASESampleShaders/Water/WaterSample" #endif v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); float4 positionCS = TransformWorldToHClip( positionWS ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; o.shadowCoord = GetShadowCoord( vertexInput ); #endif - o.clipPos = positionCS; return o; } @@ -1622,6 +1604,7 @@ Shader "ASESampleShaders/Water/WaterSample" { float4 vertex : INTERNALTESSPOS; float3 ase_normal : NORMAL; + float4 ase_tangent : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID @@ -1640,6 +1623,7 @@ Shader "ASESampleShaders/Water/WaterSample" UNITY_TRANSFER_INSTANCE_ID(v, o); o.vertex = v.vertex; o.ase_normal = v.ase_normal; + o.ase_tangent = v.ase_tangent; o.ase_texcoord = v.ase_texcoord; return o; } @@ -1679,6 +1663,7 @@ Shader "ASESampleShaders/Water/WaterSample" VertexInput o = (VertexInput) 0; o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; + o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; @@ -1697,15 +1682,27 @@ Shader "ASESampleShaders/Water/WaterSample" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { - UNITY_SETUP_INSTANCE_ID( IN ); + UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -1715,20 +1712,7 @@ Shader "ASESampleShaders/Water/WaterSample" #endif #endif - float4 screenPos = IN.ase_texcoord2; - float4 ase_screenPosNorm = screenPos / screenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float eyeDepth1 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams); - float temp_output_89_0 = abs( ( eyeDepth1 - screenPos.w ) ); - float temp_output_94_0 = saturate( pow( abs( ( temp_output_89_0 + _WaterDepth ) ) , _WaterFalloff ) ); - float4 lerpResult13 = lerp( saturate( ( _Color - float4( 0.9,0.75,0.75,0 ) ) ) , saturate( _Color ) , temp_output_94_0); - float2 uv_Foam = IN.ase_texcoord3.xy * _Foam_ST.xy + _Foam_ST.zw; - float2 panner116 = ( 1.0 * _Time.y * ( _FoamSpeed * float2( 0.1,0.1 ) ) + uv_Foam); - float temp_output_114_0 = ( saturate( pow( abs( ( temp_output_89_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner116 ).r ); - float4 lerpResult117 = lerp( lerpResult13 , saturate( ( _Color + float4( 0.08664116,0.5566038,0.5300022,0 ) ) ) , temp_output_114_0); - float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos ); - float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; - float2 uv_WaterNormal = IN.ase_texcoord3.xy * _WaterNormal_ST.xy + _WaterNormal_ST.zw; + float2 uv_WaterNormal = IN.ase_texcoord4.xy * _WaterNormal_ST.xy + _WaterNormal_ST.zw; float2 panner22 = ( 1.0 * _Time.y * ( _WaterSpeed * float2( 0.1,0.1 ) ) + uv_WaterNormal); // *** BEGIN Flipbook UV Animation vars *** // Total tiles of Flipbook Texture @@ -1779,934 +1763,50 @@ Shader "ASESampleShaders/Water/WaterSample" float3 unpack17 = UnpackNormalScale( tex2D( _WaterNormal, fbuv187 ), _NormalScale ); unpack17.z = lerp( 1, unpack17.z, saturate(_NormalScale) ); float3 temp_output_24_0 = BlendNormal( unpack23 , unpack17 ); - float4 fetchOpaqueVal65 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( float3( (ase_grabScreenPosNorm).xy , 0.0 ) + ( temp_output_24_0 * _Distortion ) ).xy ), 1.0 ); - float4 lerpResult93 = lerp( lerpResult117 , fetchOpaqueVal65 , temp_output_94_0); - - float3 Albedo = lerpResult93.rgb; + float3 Normal = temp_output_24_0; float Alpha = 1; float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); + #ifdef ASE_DEPTH_WRITE_ON + float DepthValue = 0; + #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _SPECULAR_SETUP 1 - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float4 _Foam_ST; - float4 _WaterNormal_ST; - float2 _FoamSpeed; - float2 _WaterSpeed; - float2 _WaterSpeedAlso; - float _WaterDepth; - float _WaterFalloff; - float _FoamDepth; - float _FoamFalloff; - float _NormalScale; - float _Distortion; - float _WaterSpecular; - float _FoamSpecular; - float _WaterSmoothness; - float _FoamSmoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - sampler2D _WaterNormal; - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord4.xy = v.ase_texcoord.xy; - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord4.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; + + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); + + #if defined(_NORMALMAP) + #if _NORMAL_DROPOFF_TS + float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); + float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); + float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); + #elif _NORMAL_DROPOFF_OS + float3 normalWS = TransformObjectToWorldNormal(Normal); + #elif _NORMAL_DROPOFF_WS + float3 normalWS = Normal; + #endif + #else + float3 normalWS = WorldNormal; + #endif - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; + return half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 ase_texcoord : TEXCOORD0; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.ase_texcoord = v.ase_texcoord; - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - float2 uv_WaterNormal = IN.ase_texcoord4.xy * _WaterNormal_ST.xy + _WaterNormal_ST.zw; - float2 panner22 = ( 1.0 * _Time.y * ( _WaterSpeed * float2( 0.1,0.1 ) ) + uv_WaterNormal); - // *** BEGIN Flipbook UV Animation vars *** - // Total tiles of Flipbook Texture - float fbtotaltiles184 = 8.0 * 8.0; - // Offsets for cols and rows of Flipbook Texture - float fbcolsoffset184 = 1.0f / 8.0; - float fbrowsoffset184 = 1.0f / 8.0; - // Speed of animation - float fbspeed184 = _TimeParameters.x * 24.0; - // UV Tiling (col and row offset) - float2 fbtiling184 = float2(fbcolsoffset184, fbrowsoffset184); - // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset) - // Calculate current tile linear index - float fbcurrenttileindex184 = round( fmod( fbspeed184 + 0.0, fbtotaltiles184) ); - fbcurrenttileindex184 += ( fbcurrenttileindex184 < 0) ? fbtotaltiles184 : 0; - // Obtain Offset X coordinate from current tile linear index - float fblinearindextox184 = round ( fmod ( fbcurrenttileindex184, 8.0 ) ); - // Multiply Offset X by coloffset - float fboffsetx184 = fblinearindextox184 * fbcolsoffset184; - // Obtain Offset Y coordinate from current tile linear index - float fblinearindextoy184 = round( fmod( ( fbcurrenttileindex184 - fblinearindextox184 ) / 8.0, 8.0 ) ); - // Reverse Y to get tiles from Top to Bottom - fblinearindextoy184 = (int)(8.0-1) - fblinearindextoy184; - // Multiply Offset Y by rowoffset - float fboffsety184 = fblinearindextoy184 * fbrowsoffset184; - // UV Offset - float2 fboffset184 = float2(fboffsetx184, fboffsety184); - // Flipbook UV - half2 fbuv184 = frac( panner22 ) * fbtiling184 + fboffset184; - // *** END Flipbook UV Animation vars *** - float3 unpack23 = UnpackNormalScale( tex2D( _WaterNormal, fbuv184 ), _NormalScale ); - unpack23.z = lerp( 1, unpack23.z, saturate(_NormalScale) ); - float2 panner19 = ( 1.0 * _Time.y * ( _WaterSpeedAlso * float2( 0.1,0.1 ) ) + uv_WaterNormal); - float fbtotaltiles187 = 8.0 * 8.0; - float fbcolsoffset187 = 1.0f / 8.0; - float fbrowsoffset187 = 1.0f / 8.0; - float fbspeed187 = _TimeParameters.x * 24.0; - float2 fbtiling187 = float2(fbcolsoffset187, fbrowsoffset187); - float fbcurrenttileindex187 = round( fmod( fbspeed187 + 0.0, fbtotaltiles187) ); - fbcurrenttileindex187 += ( fbcurrenttileindex187 < 0) ? fbtotaltiles187 : 0; - float fblinearindextox187 = round ( fmod ( fbcurrenttileindex187, 8.0 ) ); - float fboffsetx187 = fblinearindextox187 * fbcolsoffset187; - float fblinearindextoy187 = round( fmod( ( fbcurrenttileindex187 - fblinearindextox187 ) / 8.0, 8.0 ) ); - fblinearindextoy187 = (int)(8.0-1) - fblinearindextoy187; - float fboffsety187 = fblinearindextoy187 * fbrowsoffset187; - float2 fboffset187 = float2(fboffsetx187, fboffsety187); - half2 fbuv187 = frac( panner19 ) * fbtiling187 + fboffset187; - float3 unpack17 = UnpackNormalScale( tex2D( _WaterNormal, fbuv187 ), _NormalScale ); - unpack17.z = lerp( 1, unpack17.z, saturate(_NormalScale) ); - float3 temp_output_24_0 = BlendNormal( unpack23 , unpack17 ); - - float3 Normal = temp_output_24_0; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha - ColorMask RGBA - - - HLSLPROGRAM - - #define _SPECULAR_SETUP 1 - #define _NORMAL_DROPOFF_TS 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _NORMALMAP 1 - #define ASE_SRP_VERSION 120110 - #define REQUIRE_DEPTH_TEXTURE 1 - #define REQUIRE_OPAQUE_TEXTURE 1 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_SCREEN_POSITION - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _Color; - float4 _Foam_ST; - float4 _WaterNormal_ST; - float2 _FoamSpeed; - float2 _WaterSpeed; - float2 _WaterSpeedAlso; - float _WaterDepth; - float _WaterFalloff; - float _FoamDepth; - float _FoamFalloff; - float _NormalScale; - float _Distortion; - float _WaterSpecular; - float _FoamSpecular; - float _WaterSmoothness; - float _FoamSmoothness; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - uniform float4 _CameraDepthTexture_TexelSize; - sampler2D _Foam; - sampler2D _WaterNormal; - - - inline float4 ASE_ComputeGrabScreenPos( float4 pos ) - { - #if UNITY_UV_STARTS_AT_TOP - float scale = -1.0; - #else - float scale = 1.0; - #endif - float4 o = pos; - o.y = pos.w * 0.5f; - o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; - return o; - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xy = v.texcoord.xy; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.zw = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float4 ase_screenPosNorm = ScreenPos / ScreenPos.w; - ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; - float eyeDepth1 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams); - float temp_output_89_0 = abs( ( eyeDepth1 - ScreenPos.w ) ); - float temp_output_94_0 = saturate( pow( abs( ( temp_output_89_0 + _WaterDepth ) ) , _WaterFalloff ) ); - float4 lerpResult13 = lerp( saturate( ( _Color - float4( 0.9,0.75,0.75,0 ) ) ) , saturate( _Color ) , temp_output_94_0); - float2 uv_Foam = IN.ase_texcoord8.xy * _Foam_ST.xy + _Foam_ST.zw; - float2 panner116 = ( 1.0 * _Time.y * ( _FoamSpeed * float2( 0.1,0.1 ) ) + uv_Foam); - float temp_output_114_0 = ( saturate( pow( abs( ( temp_output_89_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner116 ).r ); - float4 lerpResult117 = lerp( lerpResult13 , saturate( ( _Color + float4( 0.08664116,0.5566038,0.5300022,0 ) ) ) , temp_output_114_0); - float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos ); - float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; - float2 uv_WaterNormal = IN.ase_texcoord8.xy * _WaterNormal_ST.xy + _WaterNormal_ST.zw; - float2 panner22 = ( 1.0 * _Time.y * ( _WaterSpeed * float2( 0.1,0.1 ) ) + uv_WaterNormal); - // *** BEGIN Flipbook UV Animation vars *** - // Total tiles of Flipbook Texture - float fbtotaltiles184 = 8.0 * 8.0; - // Offsets for cols and rows of Flipbook Texture - float fbcolsoffset184 = 1.0f / 8.0; - float fbrowsoffset184 = 1.0f / 8.0; - // Speed of animation - float fbspeed184 = _TimeParameters.x * 24.0; - // UV Tiling (col and row offset) - float2 fbtiling184 = float2(fbcolsoffset184, fbrowsoffset184); - // UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset) - // Calculate current tile linear index - float fbcurrenttileindex184 = round( fmod( fbspeed184 + 0.0, fbtotaltiles184) ); - fbcurrenttileindex184 += ( fbcurrenttileindex184 < 0) ? fbtotaltiles184 : 0; - // Obtain Offset X coordinate from current tile linear index - float fblinearindextox184 = round ( fmod ( fbcurrenttileindex184, 8.0 ) ); - // Multiply Offset X by coloffset - float fboffsetx184 = fblinearindextox184 * fbcolsoffset184; - // Obtain Offset Y coordinate from current tile linear index - float fblinearindextoy184 = round( fmod( ( fbcurrenttileindex184 - fblinearindextox184 ) / 8.0, 8.0 ) ); - // Reverse Y to get tiles from Top to Bottom - fblinearindextoy184 = (int)(8.0-1) - fblinearindextoy184; - // Multiply Offset Y by rowoffset - float fboffsety184 = fblinearindextoy184 * fbrowsoffset184; - // UV Offset - float2 fboffset184 = float2(fboffsetx184, fboffsety184); - // Flipbook UV - half2 fbuv184 = frac( panner22 ) * fbtiling184 + fboffset184; - // *** END Flipbook UV Animation vars *** - float3 unpack23 = UnpackNormalScale( tex2D( _WaterNormal, fbuv184 ), _NormalScale ); - unpack23.z = lerp( 1, unpack23.z, saturate(_NormalScale) ); - float2 panner19 = ( 1.0 * _Time.y * ( _WaterSpeedAlso * float2( 0.1,0.1 ) ) + uv_WaterNormal); - float fbtotaltiles187 = 8.0 * 8.0; - float fbcolsoffset187 = 1.0f / 8.0; - float fbrowsoffset187 = 1.0f / 8.0; - float fbspeed187 = _TimeParameters.x * 24.0; - float2 fbtiling187 = float2(fbcolsoffset187, fbrowsoffset187); - float fbcurrenttileindex187 = round( fmod( fbspeed187 + 0.0, fbtotaltiles187) ); - fbcurrenttileindex187 += ( fbcurrenttileindex187 < 0) ? fbtotaltiles187 : 0; - float fblinearindextox187 = round ( fmod ( fbcurrenttileindex187, 8.0 ) ); - float fboffsetx187 = fblinearindextox187 * fbcolsoffset187; - float fblinearindextoy187 = round( fmod( ( fbcurrenttileindex187 - fblinearindextox187 ) / 8.0, 8.0 ) ); - fblinearindextoy187 = (int)(8.0-1) - fblinearindextoy187; - float fboffsety187 = fblinearindextoy187 * fbrowsoffset187; - float2 fboffset187 = float2(fboffsetx187, fboffsety187); - half2 fbuv187 = frac( panner19 ) * fbtiling187 + fboffset187; - float3 unpack17 = UnpackNormalScale( tex2D( _WaterNormal, fbuv187 ), _NormalScale ); - unpack17.z = lerp( 1, unpack17.z, saturate(_NormalScale) ); - float3 temp_output_24_0 = BlendNormal( unpack23 , unpack17 ); - float4 fetchOpaqueVal65 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( float3( (ase_grabScreenPosNorm).xy , 0.0 ) + ( temp_output_24_0 * _Distortion ) ).xy ), 1.0 ); - float4 lerpResult93 = lerp( lerpResult117 , fetchOpaqueVal65 , temp_output_94_0); - - float lerpResult130 = lerp( _WaterSpecular , _FoamSpecular , temp_output_114_0); - float3 temp_cast_4 = (lerpResult130).xxx; - - float lerpResult133 = lerp( _WaterSmoothness , _FoamSmoothness , temp_output_114_0); - - float3 Albedo = lerpResult93.rgb; - float3 Normal = temp_output_24_0; - float3 Emission = saturate( ( _Color - float4( 1,1,1,0 ) ) ).rgb; - float3 Specular = temp_cast_4; - float Metallic = 0; - float Smoothness = lerpResult133; - float Occlusion = 1; - float Alpha = 1; - float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); - #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; - #endif - - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; - #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; - #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; - #else - inputData.vertexSH = SH; - #endif - #endif - - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); } - ENDHLSL } @@ -3252,7 +2352,7 @@ Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;171;1838.601,-748.1998;Floa Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;169;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;167;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;170;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;168;1838.601,-748.1998;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;ASESampleShaders/Water/WaterSample;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;0;0;Surface;1;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;638123056561315854; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638123056513254956;LOD CrossFade;0;638123056620207119;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;True;True;True;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;168;1838.601,-748.1998;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;ASESampleShaders/Water/WaterSample;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;0;0;Surface;1;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;638123056561315854; Use Shadow Threshold;0;0;Receive Shadows;1;0;GPU Instancing;0;638123056513254956;LOD CrossFade;0;638123056620207119;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;False;True;False;True;True;False;;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;205;1838.601,-668.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;19;0;21;0 WireConnection;19;2;179;0 @@ -3335,4 +2435,4 @@ WireConnection;168;2;193;0 WireConnection;168;9;130;0 WireConnection;168;4;133;0 ASEEND*/ -//CHKSM=B0E5C53FB08D83E7A7220C116EAEAE9FFD713424 \ No newline at end of file +//CHKSM=620C03746C1C7899D5DBF78D00660149C553B8B3 diff --git a/Assets/KoboldKare/SurfMap/parquet_wood_big.mat b/Assets/KoboldKare/SurfMap/parquet_wood_big.mat index 44f7c458e..207178555 100644 --- a/Assets/KoboldKare/SurfMap/parquet_wood_big.mat +++ b/Assets/KoboldKare/SurfMap/parquet_wood_big.mat @@ -10,11 +10,7 @@ Material: m_Name: parquet_wood_big m_Shader: {fileID: 4800000, guid: 9360c483d0aebd74f89a07886916938c, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _METALLICGLOSSMAP_ON - - _METALLICSPECGLOSSMAP - - _NORMALMAP - - _NORMALMAP_ON + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 diff --git a/Assets/KoboldKare/Waterfall/WaterStream.shader b/Assets/KoboldKare/Waterfall/WaterStream.shader index 935bb8a07..aaa85b8ab 100644 --- a/Assets/KoboldKare/Waterfall/WaterStream.shader +++ b/Assets/KoboldKare/Waterfall/WaterStream.shader @@ -195,27 +195,27 @@ Shader "ChastityCatastrophe/WaterStream" #define REQUIRE_OPAQUE_TEXTURE 1 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -1096,7 +1096,7 @@ Shader "ChastityCatastrophe/WaterStream" #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -2104,21 +2104,21 @@ Shader "ChastityCatastrophe/WaterStream" #define REQUIRE_OPAQUE_TEXTURE 1 - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED +#pragma multi_compile __ _SHADOWS_SOFT +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _GBUFFER_NORMALS_OCT +#pragma multi_compile __ _LIGHT_LAYERS +#pragma multi_compile __ _RENDER_PASS_ENABLED #pragma vertex vert #pragma fragment frag @@ -3271,4 +3271,4 @@ WireConnection;168;9;130;0 WireConnection;168;4;133;0 WireConnection;168;8;179;0 ASEEND*/ -//CHKSM=A60ABFBDAB10BB5A868F4F709311788ECA5F33E2 \ No newline at end of file +//CHKSM=A60ABFBDAB10BB5A868F4F709311788ECA5F33E2 diff --git a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeLeft.mat b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeLeft.mat index ac0fc7756..90ebda833 100644 --- a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeLeft.mat +++ b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeLeft.mat @@ -10,9 +10,7 @@ Material: m_Name: ExampleEyeLeft m_Shader: {fileID: 4800000, guid: 5e1d12dd9f331b94da153b99f92b9e11, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -86,6 +84,18 @@ Material: 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: - _AlphaCutoff: 0.5 @@ -106,6 +116,7 @@ Material: - _GlossMapScale: 1 - _Glossiness: 1 - _GlossyReflections: 1 + - _Head: 0 - _IrisBlend: 0.065 - _IrisBlend1: 0.097 - _IrisSize: 0.343 @@ -123,6 +134,8 @@ Material: - _Parallax: 0.02 - _PupilDialationFrequency: 0.352 - _PupilDialationFrequency1: 0.352 + - _QueueControl: 0 + - _QueueOffset: 0 - _Smooth: 0 - _SmoothnessTextureChannel: 0 - _Specular: 0 @@ -139,6 +152,7 @@ Material: - _Blood1: {r: 0.47058815, g: 0.37370238, b: 0.37370238, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - _IrisRing: {r: 0.1102941, g: 0.1102941, b: 0.1102941, a: 0.434} - _IrisRing1: {r: 0, g: 0, b: 0, a: 0.491} - _Scelera: {r: 0.6838235, g: 0.6644046, b: 0.6134299, a: 1} diff --git a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeRight.mat b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeRight.mat index da26d9ac8..e4724e8fc 100644 --- a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeRight.mat +++ b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/ExampleEyeRight.mat @@ -10,9 +10,7 @@ Material: m_Name: ExampleEyeRight m_Shader: {fileID: 4800000, guid: 5e1d12dd9f331b94da153b99f92b9e11, type: 3} m_ValidKeywords: [] - m_InvalidKeywords: - - _EMISSION - - _NORMALMAP + m_InvalidKeywords: [] m_LightmapFlags: 0 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -82,8 +80,21 @@ Material: 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: + - _AlphaCutoff: 0.5 - _Backward: 0 - _BumpPower: 0.477 - _BumpScale: 1 @@ -101,6 +112,7 @@ Material: - _GlossMapScale: 1 - _Glossiness: 1 - _GlossyReflections: 1 + - _Head: 0 - _IrisBlend: 0.065 - _IrisBlend1: 0.097 - _IrisSize: 0.343 @@ -118,6 +130,8 @@ Material: - _Parallax: 0.02 - _PupilDialationFrequency: 0.352 - _PupilDialationFrequency1: 0.352 + - _QueueControl: 0 + - _QueueOffset: 0 - _Smooth: 0 - _SmoothnessTextureChannel: 0 - _Specular: 0 @@ -134,6 +148,7 @@ Material: - _Blood1: {r: 0.47058815, g: 0.37370238, b: 0.37370238, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _HueBrightnessContrastSaturation: {r: 0, g: 0.5, b: 0.5, a: 0.5} - _IrisRing: {r: 0.1102941, g: 0.1102941, b: 0.1102941, a: 0.434} - _IrisRing1: {r: 0, g: 0, b: 0, a: 0.491} - _Scelera: {r: 0.6838235, g: 0.6644046, b: 0.6134299, a: 1} diff --git a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/VilarEyeV2.shader b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/VilarEyeV2.shader index d9b1a9120..75174ef21 100644 --- a/Assets/ThirdParty/Plugins/Vilar/VilarEyes/VilarEyeV2.shader +++ b/Assets/ThirdParty/Plugins/Vilar/VilarEyes/VilarEyeV2.shader @@ -1,4 +1,4 @@ -// Made with Amplify Shader Editor +// Made with Amplify Shader Editor v1.9.1.5 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Vilar/EyeV2" { @@ -62,7 +62,7 @@ Shader "Vilar/EyeV2" #pragma target 3.0 #pragma prefer_hlslcc gles - #pragma exclude_renderers d3d11_9x + #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS @@ -188,30 +188,30 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF - #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE +#pragma multi_compile __ _SCREEN_SPACE_OCCLUSION +#pragma multi_compile __ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN +#pragma multi_compile __ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF +#pragma multi_compile __ _ADDITIONAL_LIGHT_SHADOWS +#pragma multi_compile __ _SHADOWS_SOFT +#pragma multi_compile __ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ SHADOWS_SHADOWMASK +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_SHADOW_MIXING +#pragma multi_compile __ SHADOWS_SHADOWMASK - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON +// Disabled by Shader Control: #pragma multi_compile __ DIRLIGHTMAP_COMBINED +// Disabled by Shader Control: #pragma multi_compile __ LIGHTMAP_ON +#pragma multi_compile __ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _LIGHT_LAYERS +#pragma multi_compile __ _REFLECTION_PROBE_BLENDING +#pragma multi_compile __ _REFLECTION_PROBE_BOX_PROJECTION +#pragma multi_compile __ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 +#pragma multi_compile __ _LIGHT_LAYERS - #pragma multi_compile _ _LIGHT_COOKIES - #pragma multi_compile _ _CLUSTERED_RENDERING +#pragma multi_compile __ _LIGHT_COOKIES +#pragma multi_compile __ _CLUSTERED_RENDERING #pragma vertex vert #pragma fragment frag @@ -942,7 +942,7 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert @@ -1205,13 +1205,13 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #pragma shader_feature _ EDITOR_VISUALIZATION +#pragma shader_feature_local __ EDITOR_VISUALIZATION #define SHADERPASS SHADERPASS_META @@ -1442,7 +1442,7 @@ Shader "Vilar/EyeV2" o.ase_texcoord5.xyz = ase_worldTangent; float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); o.ase_texcoord6.xyz = ase_worldNormal; - float ase_vertexTangentSign = v.ase_tangent.w * unity_WorldTransformParams.w; + float ase_vertexTangentSign = v.ase_tangent.w * ( unity_WorldTransformParams.w >= 0.0 ? 1.0 : -1.0 ); float3 ase_worldBitangent = cross( ase_worldNormal, ase_worldTangent ) * ase_vertexTangentSign; o.ase_texcoord7.xyz = ase_worldBitangent; @@ -1693,11 +1693,13 @@ Shader "Vilar/EyeV2" Pass { - Name "Universal2D" - Tags { "LightMode"="Universal2D" } + Name "DepthNormals" + Tags { "LightMode"="DepthNormals" } - Blend One Zero, One Zero - ColorMask RGBA + ZWrite On + Blend One Zero + ZTest LEqual + ZWrite On HLSLPROGRAM @@ -1708,32 +1710,27 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 #pragma vertex vert #pragma fragment frag - #define SHADERPASS SHADERPASS_2D - - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" - - #define ASE_NEEDS_FRAG_WORLD_POSITION - #define ASE_NEEDS_VERT_NORMAL + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + struct VertexInput { float4 vertex : POSITION; float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; float4 ase_tangent : TANGENT; + UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -1746,10 +1743,9 @@ Shader "Vilar/EyeV2" #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif - float4 ase_texcoord2 : TEXCOORD2; - float4 ase_texcoord3 : TEXCOORD3; - float4 ase_texcoord4 : TEXCOORD4; - float4 ase_texcoord5 : TEXCOORD5; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -1789,164 +1785,16 @@ Shader "Vilar/EyeV2" float _TessMaxDisp; #endif CBUFFER_END - samplerCUBE _StylizedReflection; - sampler2D _BumpMap; - sampler2D _Albedo; - sampler2D _ParallaxHeight; - - - float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } - float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } - float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } - float snoise( float2 v ) - { - const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); - float2 i = floor( v + dot( v, C.yy ) ); - float2 x0 = v - i + dot( i, C.xx ); - float2 i1; - i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); - float4 x12 = x0.xyxy + C.xxzz; - x12.xy -= i1; - i = mod2D289( i ); - float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); - float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); - m = m * m; - m = m * m; - float3 x = 2.0 * frac( p * C.www ) - 1.0; - float3 h = abs( x ) - 0.5; - float3 ox = floor( x + 0.5 ); - float3 a0 = x - ox; - m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); - float3 g; - g.x = a0.x * x0.x + h.x * x0.y; - g.yz = a0.yz * x12.xz + h.yz * x12.yw; - return 130.0 * dot( m, g ); - } - - float2 ParallaxOcclusionDialated600( float3 normalWorld, sampler2D heightMap, float2 uvs, float3 viewWorld, float3 viewDirTan, float parallax, float refPlane, float currentDialation, float irisSize ) - { - float2 dx = ddx(uvs); - float2 dy = ddy(uvs); - float minSamples = 8; - float maxSamples = 16; - float3 result = 0; - int stepIndex = 0; - int numSteps = ( int )lerp( (float)maxSamples, (float)minSamples, (float)dot( normalWorld, viewWorld ) ); - float layerHeight = 1.0 / numSteps; - float2 plane = parallax * ( viewDirTan.xy / viewDirTan.z ); - uvs += refPlane * plane; - float2 deltaTex = -plane * layerHeight; - float2 prevTexOffset = 0; - float prevRayZ = 1.0f; - float prevHeight = 0.0f; - float2 currTexOffset = deltaTex; - float currRayZ = 1.0f - layerHeight; - float currHeight = 0.0f; - float intersection = 0; - float2 finalTexOffset = 0; - float2 dialatedUV = 0; - float dialatedCenterDist = 0; - while ( stepIndex < numSteps + 1 ) - { - dialatedUV = uvs + currTexOffset - float2(0.5,0.5); - dialatedCenterDist = length(dialatedUV); - dialatedCenterDist = max(0, currentDialation + dialatedCenterDist * (irisSize - currentDialation) / irisSize); - dialatedUV = normalize(dialatedUV) * dialatedCenterDist; - dialatedUV += float2(0.5,0.5); - currHeight = tex2Dgrad( heightMap, dialatedUV, dx, dy ).r; - if ( currHeight > currRayZ ) - { - stepIndex = numSteps + 1; - } - else - { - stepIndex++; - prevTexOffset = currTexOffset; - prevRayZ = currRayZ; - prevHeight = currHeight; - currTexOffset += deltaTex; - currRayZ -= layerHeight; - } - } - int sectionSteps = 2; - int sectionIndex = 0; - float newZ = 0; - float newHeight = 0; - while ( sectionIndex < sectionSteps ) - { - intersection = ( prevHeight - prevRayZ ) / ( prevHeight - currHeight + currRayZ - prevRayZ ); - finalTexOffset = prevTexOffset + intersection * deltaTex; - dialatedUV = uvs + finalTexOffset - float2(0.5,0.5); - dialatedCenterDist = length(dialatedUV); - dialatedCenterDist = max(0, currentDialation + dialatedCenterDist * (irisSize - currentDialation) / irisSize); - dialatedUV = normalize(dialatedUV) * dialatedCenterDist; - dialatedUV += float2(0.5,0.5); - newZ = prevRayZ - intersection * layerHeight; - newHeight = tex2Dgrad( heightMap, dialatedUV, dx, dy ).r; - if ( newHeight > newZ ) - { - currTexOffset = finalTexOffset; - currHeight = newHeight; - currRayZ = newZ; - deltaTex = intersection * deltaTex; - layerHeight = intersection * layerHeight; - } - else - { - prevTexOffset = finalTexOffset; - prevHeight = newHeight; - prevRayZ = newZ; - deltaTex = ( 1 - intersection ) * deltaTex; - layerHeight = ( 1 - intersection ) * layerHeight; - } - sectionIndex++; - } - return dialatedUV; - } - - float4 MyCustomExpression1_g9( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } + VertexOutput VertexFunction( VertexInput v ) { VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID( v ); - UNITY_TRANSFER_INSTANCE_ID( v, o ); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o ); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - float3 ase_worldTangent = TransformObjectToWorldDir(v.ase_tangent.xyz); - o.ase_texcoord3.xyz = ase_worldTangent; - float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal); - o.ase_texcoord4.xyz = ase_worldNormal; - float ase_vertexTangentSign = v.ase_tangent.w * unity_WorldTransformParams.w; - float3 ase_worldBitangent = cross( ase_worldNormal, ase_worldTangent ) * ase_vertexTangentSign; - o.ase_texcoord5.xyz = ase_worldBitangent; - - o.ase_texcoord2.xyz = v.ase_texcoord.xyz; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord2.w = 0; - o.ase_texcoord3.w = 0; - o.ase_texcoord4.w = 0; - o.ase_texcoord5.w = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; @@ -1961,21 +1809,24 @@ Shader "Vilar/EyeV2" #endif v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); + float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); + float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); float4 positionCS = TransformWorldToHClip( positionWS ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) o.worldPos = positionWS; #endif + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; o.shadowCoord = GetShadowCoord( vertexInput ); #endif - o.clipPos = positionCS; return o; } @@ -1985,9 +1836,8 @@ Shader "Vilar/EyeV2" { float4 vertex : INTERNALTESSPOS; float3 ase_normal : NORMAL; - float4 ase_texcoord : TEXCOORD0; float4 ase_tangent : TANGENT; - + UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -2004,8 +1854,8 @@ Shader "Vilar/EyeV2" UNITY_TRANSFER_INSTANCE_ID(v, o); o.vertex = v.vertex; o.ase_normal = v.ase_normal; - o.ase_texcoord = v.ase_texcoord; o.ase_tangent = v.ase_tangent; + return o; } @@ -2044,8 +1894,8 @@ Shader "Vilar/EyeV2" VertexInput o = (VertexInput) 0; o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; + #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) @@ -2063,15 +1913,27 @@ Shader "Vilar/EyeV2" } #endif - half4 frag(VertexOutput IN ) : SV_TARGET + #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) + #define ASE_SV_DEPTH SV_DepthLessEqual + #else + #define ASE_SV_DEPTH SV_Depth + #endif + half4 frag( VertexOutput IN + #ifdef ASE_DEPTH_WRITE_ON + ,out float outputDepth : ASE_SV_DEPTH + #endif + ) : SV_TARGET { - UNITY_SETUP_INSTANCE_ID( IN ); + UNITY_SETUP_INSTANCE_ID(IN); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = IN.worldPos; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); + + float3 WorldNormal = IN.worldNormal; + float4 WorldTangent = IN.worldTangent; #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) @@ -2081,939 +1943,10 @@ Shader "Vilar/EyeV2" #endif #endif - float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition ); - ase_worldViewDir = normalize(ase_worldViewDir); - float2 texCoord652 = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 ); - float mulTime398 = _TimeParameters.x * 0.8; - float temp_output_410_0 = round( mulTime398 ); - float2 temp_cast_3 = (temp_output_410_0).xx; - float simplePerlin2D389 = snoise( temp_cast_3 ); - float2 temp_cast_4 = (( temp_output_410_0 + 123.234 )).xx; - float simplePerlin2D403 = snoise( temp_cast_4 ); - float3 appendResult395 = (float3(( -0.5 + simplePerlin2D389 ) , ( -0.5 + simplePerlin2D403 ) , 0.0)); - float temp_output_418_0 = round( ( mulTime398 + 0.5 ) ); - float2 temp_cast_5 = (temp_output_418_0).xx; - float simplePerlin2D425 = snoise( temp_cast_5 ); - float2 temp_cast_6 = (( temp_output_418_0 + 123.234 )).xx; - float simplePerlin2D426 = snoise( temp_cast_6 ); - float3 appendResult424 = (float3(( -0.5 + simplePerlin2D425 ) , ( -0.5 + simplePerlin2D426 ) , 0.0)); - float3 lerpResult429 = lerp( appendResult395 , appendResult424 , saturate( ( fmod( mulTime398 , 1.0 ) * 14.0 ) )); - float mulTime445 = _TimeParameters.x * ( 0.2 + ( 0.3 * _TwitchShiftyness ) ); - float2 temp_cast_7 = (mulTime445).xx; - float simplePerlin2D447 = snoise( temp_cast_7 ); - float3 lerpResult453 = lerp( lerpResult429 , float3(0,0,0) , saturate( ( ( simplePerlin2D447 + -( _TwitchShiftyness + -0.5 ) ) * 14.0 ) )); - float3 temp_output_411_0 = ( _TwitchMagnitude * lerpResult453 ); - float2 temp_output_5_0_g8 = ( ( ( float3( frac( texCoord652 ) , 0.0 ) + temp_output_411_0 ).xy + float2( 0,0 ) ) + float2( -0.5,-0.5 ) ); - float2 temp_output_6_0_g8 = ( temp_output_5_0_g8 * ( 1.0 / _IrisSize ) ); - float2 temp_output_650_29 = saturate( ( temp_output_6_0_g8 + float2( 0.5,0.5 ) ) ); - float smoothstepResult12_g8 = smoothstep( ( 0.45 - _IrisBlend ) , 0.45 , length( temp_output_6_0_g8 )); - float temp_output_650_30 = smoothstepResult12_g8; - float3 lerpResult646 = lerp( UnpackNormalScale( tex2D( _BumpMap, ( float3( temp_output_650_29 , 0.0 ) + temp_output_411_0 ).xy ), 1.0f ) , float3(0,0,1) , temp_output_650_30); - float3 ase_worldTangent = IN.ase_texcoord3.xyz; - float3 ase_worldNormal = IN.ase_texcoord4.xyz; - float3 ase_worldBitangent = IN.ase_texcoord5.xyz; - float3 tanToWorld0 = float3( ase_worldTangent.x, ase_worldBitangent.x, ase_worldNormal.x ); - float3 tanToWorld1 = float3( ase_worldTangent.y, ase_worldBitangent.y, ase_worldNormal.y ); - float3 tanToWorld2 = float3( ase_worldTangent.z, ase_worldBitangent.z, ase_worldNormal.z ); - float3 tanNormal326 = lerpResult646; - float3 worldNormal326 = float3(dot(tanToWorld0,tanNormal326), dot(tanToWorld1,tanNormal326), dot(tanToWorld2,tanNormal326)); - float4 appendResult671 = (float4((_HueBrightnessContrastSaturation).x , 0.5 , 0.5 , 0.5)); - float4 hsbc1_g9 = appendResult671; - float3 normalWorld600 = float3( 0,0,0 ); - sampler2D heightMap600 = _ParallaxHeight; - float2 uvs600 = temp_output_650_29; - float3 viewWorld600 = ase_worldViewDir; - float3 ase_tanViewDir = tanToWorld0 * ase_worldViewDir.x + tanToWorld1 * ase_worldViewDir.y + tanToWorld2 * ase_worldViewDir.z; - ase_tanViewDir = normalize(ase_tanViewDir); - float3 viewDirTan600 = ase_tanViewDir; - float parallax600 = _Depth; - float refPlane600 = 0.0; - float mulTime578 = _TimeParameters.x * ( 0.3 * _PupilDialationFrequency ); - float2 temp_cast_14 = (mulTime578).xx; - float simplePerlin2D580 = snoise( temp_cast_14 ); - float temp_output_602_0 = (0.0 + (simplePerlin2D580 - -1.0) * (1.0 - 0.0) / (1.0 - -1.0)); - float smoothstepResult605 = smoothstep( 0.5 , ( 0.5 + 0.02 ) , distance( temp_output_650_29 , float2( 0.5,0.5 ) )); - float lerpResult603 = lerp( ( -0.5 * ( 0.5 * temp_output_602_0 ) ) , 0.0 , smoothstepResult605); - float currentDialation600 = lerpResult603; - float irisSize600 = 0.5; - float2 localParallaxOcclusionDialated600 = ParallaxOcclusionDialated600( normalWorld600 , heightMap600 , uvs600 , viewWorld600 , viewDirTan600 , parallax600 , refPlane600 , currentDialation600 , irisSize600 ); - float4 startColor1_g9 = tex2D( _Albedo, localParallaxOcclusionDialated600 ); - float4 localMyCustomExpression1_g9 = MyCustomExpression1_g9( hsbc1_g9 , startColor1_g9 ); - float4 temp_output_666_0 = localMyCustomExpression1_g9; - float smoothstepResult22_g8 = smoothstep( 0.0 , 0.5 , length( temp_output_5_0_g8 )); - float4 lerpResult636 = lerp( _Scelera , _Blood , smoothstepResult22_g8); - float4 lerpResult638 = lerp( temp_output_666_0 , lerpResult636 , temp_output_650_30); - float4 lerpResult639 = lerp( lerpResult638 , _IrisRing , ( ( ( -cos( ( smoothstepResult12_g8 * 6.283 ) ) + 1.0 ) * 0.5 ) * _IrisRing.a )); - - - float3 Albedo = ( ( texCUBElod( _StylizedReflection, float4( ( float3(-1,-1,1) * reflect( mul( unity_WorldToCamera, float4( ase_worldViewDir , 0.0 ) ).xyz , mul( unity_WorldToCamera, float4( worldNormal326 , 0.0 ) ).xyz ) ), (float)0) ).r * _MainLightColor * 1.5 ) + lerpResult639 ).rgb; - float Alpha = _Head; - float AlphaClipThreshold = 0.5; - - half4 color = half4( Albedo, Alpha ); - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - return color; - } - ENDHLSL - } - - - Pass - { - - Name "DepthNormals" - Tags { "LightMode"="DepthNormals" } - - ZWrite On - Blend One Zero - ZTest LEqual - ZWrite On - - HLSLPROGRAM - - #define _SPECULAR_SETUP 1 - #define _NORMAL_DROPOFF_TS 1 - #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 - - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 worldPos : TEXCOORD0; - #endif - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - float4 shadowCoord : TEXCOORD1; - #endif - float3 worldNormal : TEXCOORD2; - float4 worldTangent : TEXCOORD3; - - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _HueBrightnessContrastSaturation; - float4 _Scelera; - float4 _Blood; - float4 _IrisRing; - float _TwitchMagnitude; - float _TwitchShiftyness; - float _IrisSize; - float _IrisBlend; - float _Depth; - float _PupilDialationFrequency; - float _EmissionPower; - float _Specular; - float _Smooth; - float _Head; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - - v.ase_normal = v.ase_normal; - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 normalWS = TransformObjectToWorldNormal( v.ase_normal ); - float4 tangentWS = float4(TransformObjectToWorldDir( v.ase_tangent.xyz), v.ase_tangent.w); - float4 positionCS = TransformWorldToHClip( positionWS ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - o.worldPos = positionWS; - #endif - - o.worldNormal = normalWS; - o.worldTangent = tangentWS; - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - o.clipPos = positionCS; - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - half4 frag( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) : SV_TARGET - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN ); - - #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) - float3 WorldPosition = IN.worldPos; - #endif - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - - float3 WorldNormal = IN.worldNormal; - float4 WorldTangent = IN.worldTangent; - - #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #endif - #endif - - - float3 Normal = float3(0, 0, 1); - float Alpha = _Head; - float AlphaClipThreshold = 0.5; - #ifdef ASE_DEPTH_WRITE_ON - float DepthValue = 0; - #endif - - #ifdef _ALPHATEST_ON - clip(Alpha - AlphaClipThreshold); - #endif - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; - #endif - - #if defined(_GBUFFER_NORMALS_OCT) - float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); - float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); - half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); - return half4(packedNormalWS, 0.0); - #else - - #if defined(_NORMALMAP) - #if _NORMAL_DROPOFF_TS - float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); - float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); - float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); - #elif _NORMAL_DROPOFF_OS - float3 normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - float3 normalWS = Normal; - #endif - #else - float3 normalWS = WorldNormal; - #endif - - return half4(NormalizeNormalPerPixel(normalWS), 0.0); - #endif - } - ENDHLSL - } - - - Pass - { - - Name "GBuffer" - Tags { "LightMode"="UniversalGBuffer" } - - Blend One Zero, One Zero - ColorMask RGBA - - - HLSLPROGRAM - - #define _SPECULAR_SETUP 1 - #define _NORMAL_DROPOFF_TS 1 - #define _RECEIVE_SHADOWS_OFF 1 - #pragma multi_compile_fog - #define ASE_FOG 1 - #define _EMISSION - #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 - - - #pragma multi_compile _ LIGHTMAP_ON - #pragma multi_compile _ DYNAMICLIGHTMAP_ON - #pragma multi_compile _ DIRLIGHTMAP_COMBINED - #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN - - #pragma multi_compile _ _REFLECTION_PROBE_BLENDING - #pragma multi_compile _ _REFLECTION_PROBE_BOX_PROJECTION - - #pragma multi_compile _ _SHADOWS_SOFT - #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING - #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE - #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 - #pragma multi_compile _ _GBUFFER_NORMALS_OCT - #pragma multi_compile _ _LIGHT_LAYERS - #pragma multi_compile _ _RENDER_PASS_ENABLED - - #pragma vertex vert - #pragma fragment frag - - #define SHADERPASS SHADERPASS_GBUFFER - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" - - - #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) - #define ENABLE_TERRAIN_PERPIXEL_NORMAL - #endif - - #define ASE_NEEDS_FRAG_WORLD_VIEW_DIR - #define ASE_NEEDS_FRAG_WORLD_TANGENT - #define ASE_NEEDS_FRAG_WORLD_NORMAL - #define ASE_NEEDS_FRAG_WORLD_BITANGENT - - - struct VertexInput - { - float4 vertex : POSITION; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput - { - float4 clipPos : SV_POSITION; - float4 lightmapUVOrVertexSH : TEXCOORD0; - half4 fogFactorAndVertexLight : TEXCOORD1; - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - float4 shadowCoord : TEXCOORD2; - #endif - float4 tSpace0 : TEXCOORD3; - float4 tSpace1 : TEXCOORD4; - float4 tSpace2 : TEXCOORD5; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 screenPos : TEXCOORD6; - #endif - #if defined(DYNAMICLIGHTMAP_ON) - float2 dynamicLightmapUV : TEXCOORD7; - #endif - float4 ase_texcoord8 : TEXCOORD8; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO - }; - - CBUFFER_START(UnityPerMaterial) - float4 _HueBrightnessContrastSaturation; - float4 _Scelera; - float4 _Blood; - float4 _IrisRing; - float _TwitchMagnitude; - float _TwitchShiftyness; - float _IrisSize; - float _IrisBlend; - float _Depth; - float _PupilDialationFrequency; - float _EmissionPower; - float _Specular; - float _Smooth; - float _Head; - #ifdef _TRANSMISSION_ASE - float _TransmissionShadow; - #endif - #ifdef _TRANSLUCENCY_ASE - float _TransStrength; - float _TransNormal; - float _TransScattering; - float _TransDirect; - float _TransAmbient; - float _TransShadow; - #endif - #ifdef TESSELLATION_ON - float _TessPhongStrength; - float _TessValue; - float _TessMin; - float _TessMax; - float _TessEdgeLength; - float _TessMaxDisp; - #endif - CBUFFER_END - samplerCUBE _StylizedReflection; - sampler2D _BumpMap; - sampler2D _Albedo; - sampler2D _ParallaxHeight; - - - float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } - float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } - float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } - float snoise( float2 v ) - { - const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); - float2 i = floor( v + dot( v, C.yy ) ); - float2 x0 = v - i + dot( i, C.xx ); - float2 i1; - i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); - float4 x12 = x0.xyxy + C.xxzz; - x12.xy -= i1; - i = mod2D289( i ); - float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); - float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); - m = m * m; - m = m * m; - float3 x = 2.0 * frac( p * C.www ) - 1.0; - float3 h = abs( x ) - 0.5; - float3 ox = floor( x + 0.5 ); - float3 a0 = x - ox; - m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); - float3 g; - g.x = a0.x * x0.x + h.x * x0.y; - g.yz = a0.yz * x12.xz + h.yz * x12.yw; - return 130.0 * dot( m, g ); - } - - float2 ParallaxOcclusionDialated600( float3 normalWorld, sampler2D heightMap, float2 uvs, float3 viewWorld, float3 viewDirTan, float parallax, float refPlane, float currentDialation, float irisSize ) - { - float2 dx = ddx(uvs); - float2 dy = ddy(uvs); - float minSamples = 8; - float maxSamples = 16; - float3 result = 0; - int stepIndex = 0; - int numSteps = ( int )lerp( (float)maxSamples, (float)minSamples, (float)dot( normalWorld, viewWorld ) ); - float layerHeight = 1.0 / numSteps; - float2 plane = parallax * ( viewDirTan.xy / viewDirTan.z ); - uvs += refPlane * plane; - float2 deltaTex = -plane * layerHeight; - float2 prevTexOffset = 0; - float prevRayZ = 1.0f; - float prevHeight = 0.0f; - float2 currTexOffset = deltaTex; - float currRayZ = 1.0f - layerHeight; - float currHeight = 0.0f; - float intersection = 0; - float2 finalTexOffset = 0; - float2 dialatedUV = 0; - float dialatedCenterDist = 0; - while ( stepIndex < numSteps + 1 ) - { - dialatedUV = uvs + currTexOffset - float2(0.5,0.5); - dialatedCenterDist = length(dialatedUV); - dialatedCenterDist = max(0, currentDialation + dialatedCenterDist * (irisSize - currentDialation) / irisSize); - dialatedUV = normalize(dialatedUV) * dialatedCenterDist; - dialatedUV += float2(0.5,0.5); - currHeight = tex2Dgrad( heightMap, dialatedUV, dx, dy ).r; - if ( currHeight > currRayZ ) - { - stepIndex = numSteps + 1; - } - else - { - stepIndex++; - prevTexOffset = currTexOffset; - prevRayZ = currRayZ; - prevHeight = currHeight; - currTexOffset += deltaTex; - currRayZ -= layerHeight; - } - } - int sectionSteps = 2; - int sectionIndex = 0; - float newZ = 0; - float newHeight = 0; - while ( sectionIndex < sectionSteps ) - { - intersection = ( prevHeight - prevRayZ ) / ( prevHeight - currHeight + currRayZ - prevRayZ ); - finalTexOffset = prevTexOffset + intersection * deltaTex; - dialatedUV = uvs + finalTexOffset - float2(0.5,0.5); - dialatedCenterDist = length(dialatedUV); - dialatedCenterDist = max(0, currentDialation + dialatedCenterDist * (irisSize - currentDialation) / irisSize); - dialatedUV = normalize(dialatedUV) * dialatedCenterDist; - dialatedUV += float2(0.5,0.5); - newZ = prevRayZ - intersection * layerHeight; - newHeight = tex2Dgrad( heightMap, dialatedUV, dx, dy ).r; - if ( newHeight > newZ ) - { - currTexOffset = finalTexOffset; - currHeight = newHeight; - currRayZ = newZ; - deltaTex = intersection * deltaTex; - layerHeight = intersection * layerHeight; - } - else - { - prevTexOffset = finalTexOffset; - prevHeight = newHeight; - prevRayZ = newZ; - deltaTex = ( 1 - intersection ) * deltaTex; - layerHeight = ( 1 - intersection ) * layerHeight; - } - sectionIndex++; - } - return dialatedUV; - } - - float4 MyCustomExpression1_g9( float4 hsbc, float4 startColor ) - { - float _Hue = 360 * hsbc.r; - float _Brightness = hsbc.g * 2 - 1; - float _Contrast = hsbc.b * 2; - float _Saturation = hsbc.a * 2; - - float4 outputColor = startColor; - float angle = radians(_Hue); - float3 k = float3(0.57735, 0.57735, 0.57735); - float cosAngle = cos(angle); - //Rodrigues' rotation formula - outputColor.rgb = saturate(outputColor.rgb * cosAngle + cross(k, outputColor.rgb) * sin(angle) + k * dot(k, outputColor.rgb) * (1 - cosAngle)); - outputColor.rgb = (outputColor.rgb - 0.5f) * (_Contrast) + 0.5f; - outputColor.rgb = outputColor.rgb + _Brightness; - float3 intensity = dot(outputColor.rgb, float3(0.299,0.587,0.114)); - outputColor.rgb = lerp(intensity, outputColor.rgb, _Saturation); - return saturate(outputColor); - } - - - VertexOutput VertexFunction( VertexInput v ) - { - VertexOutput o = (VertexOutput)0; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.ase_texcoord8.xyz = v.texcoord.xyz; - - //setting value to unused interpolator channels and avoid initialization warnings - o.ase_texcoord8.w = 0; - #ifdef ASE_ABSOLUTE_VERTEX_POS - float3 defaultVertexValue = v.vertex.xyz; - #else - float3 defaultVertexValue = float3(0, 0, 0); - #endif - float3 vertexValue = defaultVertexValue; - #ifdef ASE_ABSOLUTE_VERTEX_POS - v.vertex.xyz = vertexValue; - #else - v.vertex.xyz += vertexValue; - #endif - v.ase_normal = v.ase_normal; - - float3 positionWS = TransformObjectToWorld( v.vertex.xyz ); - float3 positionVS = TransformWorldToView( positionWS ); - float4 positionCS = TransformWorldToHClip( positionWS ); - - VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent ); - - o.tSpace0 = float4( normalInput.normalWS, positionWS.x); - o.tSpace1 = float4( normalInput.tangentWS, positionWS.y); - o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z); - - OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy ); - #if defined(DYNAMICLIGHTMAP_ON) - o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; - #endif - - OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz ); - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - o.lightmapUVOrVertexSH.zw = v.texcoord; - o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw; - #endif - - half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS ); - #ifdef ASE_FOG - half fogFactor = ComputeFogFactor( positionCS.z ); - #else - half fogFactor = 0; - #endif - o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - VertexPositionInputs vertexInput = (VertexPositionInputs)0; - vertexInput.positionWS = positionWS; - vertexInput.positionCS = positionCS; - o.shadowCoord = GetShadowCoord( vertexInput ); - #endif - - o.clipPos = positionCS; - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - o.screenPos = ComputeScreenPos(positionCS); - #endif - return o; - } - - #if defined(TESSELLATION_ON) - struct VertexControl - { - float4 vertex : INTERNALTESSPOS; - float3 ase_normal : NORMAL; - float4 ase_tangent : TANGENT; - float4 texcoord : TEXCOORD0; - float4 texcoord1 : TEXCOORD1; - float4 texcoord2 : TEXCOORD2; - - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct TessellationFactors - { - float edge[3] : SV_TessFactor; - float inside : SV_InsideTessFactor; - }; - - VertexControl vert ( VertexInput v ) - { - VertexControl o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_TRANSFER_INSTANCE_ID(v, o); - o.vertex = v.vertex; - o.ase_normal = v.ase_normal; - o.ase_tangent = v.ase_tangent; - o.texcoord = v.texcoord; - o.texcoord1 = v.texcoord1; - o.texcoord2 = v.texcoord2; - - return o; - } - - TessellationFactors TessellationFunction (InputPatch v) - { - TessellationFactors o; - float4 tf = 1; - float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; - float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; - #if defined(ASE_FIXED_TESSELLATION) - tf = FixedTess( tessValue ); - #elif defined(ASE_DISTANCE_TESSELLATION) - tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); - #elif defined(ASE_LENGTH_TESSELLATION) - tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); - #elif defined(ASE_LENGTH_CULL_TESSELLATION) - tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); - #endif - o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w; - return o; - } - - [domain("tri")] - [partitioning("fractional_odd")] - [outputtopology("triangle_cw")] - [patchconstantfunc("TessellationFunction")] - [outputcontrolpoints(3)] - VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) - { - return patch[id]; - } - - [domain("tri")] - VertexOutput DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) - { - VertexInput o = (VertexInput) 0; - o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z; - o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z; - o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z; - o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; - o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; - o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; - - #if defined(ASE_PHONG_TESSELLATION) - float3 pp[3]; - for (int i = 0; i < 3; ++i) - pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal)); - float phongStrength = _TessPhongStrength; - o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz; - #endif - UNITY_TRANSFER_INSTANCE_ID(patch[0], o); - return VertexFunction(o); - } - #else - VertexOutput vert ( VertexInput v ) - { - return VertexFunction( v ); - } - #endif - - #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) - #define ASE_SV_DEPTH SV_DepthLessEqual - #else - #define ASE_SV_DEPTH SV_Depth - #endif - FragmentOutput frag ( VertexOutput IN - #ifdef ASE_DEPTH_WRITE_ON - ,out float outputDepth : ASE_SV_DEPTH - #endif - ) - { - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); - - #ifdef LOD_FADE_CROSSFADE - LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); - #endif - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; - float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); - float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); - float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); - #else - float3 WorldNormal = normalize( IN.tSpace0.xyz ); - float3 WorldTangent = IN.tSpace1.xyz; - float3 WorldBiTangent = IN.tSpace2.xyz; - #endif - float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w); - float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; - float4 ShadowCoords = float4( 0, 0, 0, 0 ); - #if defined(ASE_NEEDS_FRAG_SCREEN_POSITION) - float4 ScreenPos = IN.screenPos; - #endif - - #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) - ShadowCoords = IN.shadowCoord; - #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) - ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); - #else - ShadowCoords = float4(0, 0, 0, 0); - #endif - - - - WorldViewDirection = SafeNormalize( WorldViewDirection ); - - float2 texCoord652 = IN.ase_texcoord8.xyz.xy * float2( 1,1 ) + float2( 0,0 ); - float mulTime398 = _TimeParameters.x * 0.8; - float temp_output_410_0 = round( mulTime398 ); - float2 temp_cast_3 = (temp_output_410_0).xx; - float simplePerlin2D389 = snoise( temp_cast_3 ); - float2 temp_cast_4 = (( temp_output_410_0 + 123.234 )).xx; - float simplePerlin2D403 = snoise( temp_cast_4 ); - float3 appendResult395 = (float3(( -0.5 + simplePerlin2D389 ) , ( -0.5 + simplePerlin2D403 ) , 0.0)); - float temp_output_418_0 = round( ( mulTime398 + 0.5 ) ); - float2 temp_cast_5 = (temp_output_418_0).xx; - float simplePerlin2D425 = snoise( temp_cast_5 ); - float2 temp_cast_6 = (( temp_output_418_0 + 123.234 )).xx; - float simplePerlin2D426 = snoise( temp_cast_6 ); - float3 appendResult424 = (float3(( -0.5 + simplePerlin2D425 ) , ( -0.5 + simplePerlin2D426 ) , 0.0)); - float3 lerpResult429 = lerp( appendResult395 , appendResult424 , saturate( ( fmod( mulTime398 , 1.0 ) * 14.0 ) )); - float mulTime445 = _TimeParameters.x * ( 0.2 + ( 0.3 * _TwitchShiftyness ) ); - float2 temp_cast_7 = (mulTime445).xx; - float simplePerlin2D447 = snoise( temp_cast_7 ); - float3 lerpResult453 = lerp( lerpResult429 , float3(0,0,0) , saturate( ( ( simplePerlin2D447 + -( _TwitchShiftyness + -0.5 ) ) * 14.0 ) )); - float3 temp_output_411_0 = ( _TwitchMagnitude * lerpResult453 ); - float2 temp_output_5_0_g8 = ( ( ( float3( frac( texCoord652 ) , 0.0 ) + temp_output_411_0 ).xy + float2( 0,0 ) ) + float2( -0.5,-0.5 ) ); - float2 temp_output_6_0_g8 = ( temp_output_5_0_g8 * ( 1.0 / _IrisSize ) ); - float2 temp_output_650_29 = saturate( ( temp_output_6_0_g8 + float2( 0.5,0.5 ) ) ); - float smoothstepResult12_g8 = smoothstep( ( 0.45 - _IrisBlend ) , 0.45 , length( temp_output_6_0_g8 )); - float temp_output_650_30 = smoothstepResult12_g8; - float3 lerpResult646 = lerp( UnpackNormalScale( tex2D( _BumpMap, ( float3( temp_output_650_29 , 0.0 ) + temp_output_411_0 ).xy ), 1.0f ) , float3(0,0,1) , temp_output_650_30); - float3 tanToWorld0 = float3( WorldTangent.x, WorldBiTangent.x, WorldNormal.x ); - float3 tanToWorld1 = float3( WorldTangent.y, WorldBiTangent.y, WorldNormal.y ); - float3 tanToWorld2 = float3( WorldTangent.z, WorldBiTangent.z, WorldNormal.z ); - float3 tanNormal326 = lerpResult646; - float3 worldNormal326 = float3(dot(tanToWorld0,tanNormal326), dot(tanToWorld1,tanNormal326), dot(tanToWorld2,tanNormal326)); - float4 appendResult671 = (float4((_HueBrightnessContrastSaturation).x , 0.5 , 0.5 , 0.5)); - float4 hsbc1_g9 = appendResult671; - float3 normalWorld600 = float3( 0,0,0 ); - sampler2D heightMap600 = _ParallaxHeight; - float2 uvs600 = temp_output_650_29; - float3 viewWorld600 = WorldViewDirection; - float3 ase_tanViewDir = tanToWorld0 * WorldViewDirection.x + tanToWorld1 * WorldViewDirection.y + tanToWorld2 * WorldViewDirection.z; - ase_tanViewDir = normalize(ase_tanViewDir); - float3 viewDirTan600 = ase_tanViewDir; - float parallax600 = _Depth; - float refPlane600 = 0.0; - float mulTime578 = _TimeParameters.x * ( 0.3 * _PupilDialationFrequency ); - float2 temp_cast_14 = (mulTime578).xx; - float simplePerlin2D580 = snoise( temp_cast_14 ); - float temp_output_602_0 = (0.0 + (simplePerlin2D580 - -1.0) * (1.0 - 0.0) / (1.0 - -1.0)); - float smoothstepResult605 = smoothstep( 0.5 , ( 0.5 + 0.02 ) , distance( temp_output_650_29 , float2( 0.5,0.5 ) )); - float lerpResult603 = lerp( ( -0.5 * ( 0.5 * temp_output_602_0 ) ) , 0.0 , smoothstepResult605); - float currentDialation600 = lerpResult603; - float irisSize600 = 0.5; - float2 localParallaxOcclusionDialated600 = ParallaxOcclusionDialated600( normalWorld600 , heightMap600 , uvs600 , viewWorld600 , viewDirTan600 , parallax600 , refPlane600 , currentDialation600 , irisSize600 ); - float4 startColor1_g9 = tex2D( _Albedo, localParallaxOcclusionDialated600 ); - float4 localMyCustomExpression1_g9 = MyCustomExpression1_g9( hsbc1_g9 , startColor1_g9 ); - float4 temp_output_666_0 = localMyCustomExpression1_g9; - float smoothstepResult22_g8 = smoothstep( 0.0 , 0.5 , length( temp_output_5_0_g8 )); - float4 lerpResult636 = lerp( _Scelera , _Blood , smoothstepResult22_g8); - float4 lerpResult638 = lerp( temp_output_666_0 , lerpResult636 , temp_output_650_30); - float4 lerpResult639 = lerp( lerpResult638 , _IrisRing , ( ( ( -cos( ( smoothstepResult12_g8 * 6.283 ) ) + 1.0 ) * 0.5 ) * _IrisRing.a )); - float4 color641 = IsGammaSpace() ? float4(0,0,0,0) : float4(0,0,0,0); - float4 lerpResult640 = lerp( ( temp_output_666_0 * _EmissionPower ) , color641 , temp_output_650_30); - - float3 temp_cast_20 = (_Specular).xxx; - - float3 Albedo = ( ( texCUBElod( _StylizedReflection, float4( ( float3(-1,-1,1) * reflect( mul( unity_WorldToCamera, float4( WorldViewDirection , 0.0 ) ).xyz , mul( unity_WorldToCamera, float4( worldNormal326 , 0.0 ) ).xyz ) ), (float)0) ).r * _MainLightColor * 1.5 ) + lerpResult639 ).rgb; float3 Normal = float3(0, 0, 1); - float3 Emission = lerpResult640.rgb; - float3 Specular = temp_cast_20; - float Metallic = 0; - float Smoothness = _Smooth; - float Occlusion = 1; float Alpha = _Head; float AlphaClipThreshold = 0.5; - float AlphaClipThresholdShadow = 0.5; - float3 BakedGI = 0; - float3 RefractionColor = 1; - float RefractionIndex = 1; - float3 Transmission = 1; - float3 Translucency = 1; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = 0; #endif @@ -3022,107 +1955,38 @@ Shader "Vilar/EyeV2" clip(Alpha - AlphaClipThreshold); #endif - InputData inputData = (InputData)0; - inputData.positionWS = WorldPosition; - inputData.positionCS = IN.clipPos; - inputData.shadowCoord = ShadowCoords; - - - - #ifdef _NORMALMAP - #if _NORMAL_DROPOFF_TS - inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); - #elif _NORMAL_DROPOFF_OS - inputData.normalWS = TransformObjectToWorldNormal(Normal); - #elif _NORMAL_DROPOFF_WS - inputData.normalWS = Normal; - #endif - #else - inputData.normalWS = WorldNormal; - #endif - - inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); - inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); - - - - #ifdef ASE_FOG - inputData.fogCoord = InitializeInputDataFog(float4(WorldPosition, 1.0), IN.fogFactorAndVertexLight.x); + #ifdef LOD_FADE_CROSSFADE + LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x ); #endif - - inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; - - #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) - float3 SH = SampleSH(inputData.normalWS.xyz); - #else - float3 SH = IN.lightmapUVOrVertexSH.xyz; + + #ifdef ASE_DEPTH_WRITE_ON + outputDepth = DepthValue; #endif - - - #ifdef _ASE_BAKEDGI - inputData.bakedGI = BakedGI; + #if defined(_GBUFFER_NORMALS_OCT) + float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + return half4(packedNormalWS, 0.0); #else - #if defined(DYNAMICLIGHTMAP_ON) - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS); - #else - inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS ); - #endif - #endif - - inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.clipPos); - inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy); - - #if defined(DEBUG_DISPLAY) - #if defined(DYNAMICLIGHTMAP_ON) - inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + + #if defined(_NORMALMAP) + #if _NORMAL_DROPOFF_TS + float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); + float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); + float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); + #elif _NORMAL_DROPOFF_OS + float3 normalWS = TransformObjectToWorldNormal(Normal); + #elif _NORMAL_DROPOFF_WS + float3 normalWS = Normal; #endif - #if defined(LIGHTMAP_ON) - inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy; #else - inputData.vertexSH = SH; + float3 normalWS = WorldNormal; #endif - #endif - #ifdef _DBUFFER - ApplyDecal(IN.clipPos, - Albedo, - Specular, - inputData.normalWS, - Metallic, - Occlusion, - Smoothness); - #endif - - BRDFData brdfData; - InitializeBRDFData - (Albedo, Metallic, Specular, Smoothness, Alpha, brdfData); - - Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); - half4 color; - MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); - color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); - color.a = Alpha; - - #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY - color.rgb *= color.a; - #endif - - #ifdef ASE_FOG - #ifdef TERRAIN_SPLAT_ADDPASS - color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x ); - #else - color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); - #endif - #endif - - #ifdef ASE_DEPTH_WRITE_ON - outputDepth = DepthValue; + return half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif - - return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb); } - ENDHLSL } @@ -3144,10 +2008,10 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3330,7 +2194,7 @@ Shader "Vilar/EyeV2" { SurfaceDescription surfaceDescription = (SurfaceDescription)0; - surfaceDescription.Alpha = 1; + surfaceDescription.Alpha = _Head; surfaceDescription.AlphaClipThreshold = 0.5; @@ -3365,10 +2229,10 @@ Shader "Vilar/EyeV2" #define ASE_FOG 1 #define _EMISSION #define _ALPHATEST_ON 1 - #define ASE_SRP_VERSION 999999 + #define ASE_SRP_VERSION 120110 - #pragma only_renderers d3d11 glcore gles gles3 + #pragma only_renderers d3d11 glcore gles gles3 ps5 #pragma vertex vert #pragma fragment frag @@ -3554,7 +2418,7 @@ Shader "Vilar/EyeV2" { SurfaceDescription surfaceDescription = (SurfaceDescription)0; - surfaceDescription.Alpha = 1; + surfaceDescription.Alpha = _Head; surfaceDescription.AlphaClipThreshold = 0.5; @@ -3582,8 +2446,7 @@ Shader "Vilar/EyeV2" } /*ASEBEGIN -Version=18935 -482;635;1543;905;-1277.682;1831.798;1.78005;True;False +Version=19105 Node;AmplifyShaderEditor.CommentaryNode;496;-5738.991,-2220.465;Inherit;False;2829.95;1395.959;;49;411;412;445;447;453;454;452;429;424;395;443;451;406;436;404;450;422;455;423;421;396;403;433;456;425;420;397;389;426;408;419;434;458;437;417;459;441;418;409;460;410;461;427;462;398;428;457;446;444;Twitch Noise;1,1,1,1;0;0 Node;AmplifyShaderEditor.CommentaryNode;353;-145.9124,-2266.921;Inherit;False;1532.296;565.0349;;13;298;289;299;297;303;359;360;325;357;355;326;358;323;FakeReflection;1,1,1,1;0;0 Node;AmplifyShaderEditor.CommentaryNode;354;-2544.498,-1530.722;Inherit;False;2796.808;1067.613;Comment;24;606;603;574;572;573;605;582;577;576;604;602;580;578;575;581;468;600;277;149;279;29;280;150;632;ComputedUVs;1,1,1,1;0;0 @@ -3705,16 +2568,16 @@ Node;AmplifyShaderEditor.SimpleMultiplyOpNode;298;1243.748,-1942.396;Inherit;Fal Node;AmplifyShaderEditor.SimpleAddOpNode;288;2006.191,-1730.016;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.RangedFloatNode;573;-1488.169,-857.3438;Float;False;Constant;_Float26;Float 26;18;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;667;2034.529,-1031.919;Inherit;False;Constant;_alphaClip;alphaClip;17;0;Create;True;0;0;0;False;0;False;0.5;0;0;1;0;1;FLOAT;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;683;2590.219,-1372.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;678;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;677;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;680;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;675;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;682;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;676;2590.219,-1452.336;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;2;Vilar/EyeV2;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;0;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,-1;0;Translucency;0;0; Translucency Strength;1,False,-1;0; Normal Distortion;0.5,False,-1;0; Scattering;2,False,-1;0; Direct;0.9,False,-1;0; Ambient;0.1,False,-1;0; Shadow;0.5,False,-1;0;Cast Shadows;0;0; Use Shadow Threshold;0;0;Receive Shadows;0;0;GPU Instancing;0;638122960154172775;LOD CrossFade;0;638122960159148635;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;True;True;True;True;True;False;;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;681;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;684;2590.219,-1372.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 -Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;679;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;683;2590.219,-1372.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;678;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;677;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;680;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;675;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;682;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalGBuffer;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;676;2590.219,-1452.336;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Vilar/EyeV2;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;19;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;1;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;False;False;False;True;1;LightMode=UniversalForward;False;False;0;Hidden/InternalErrorShader;0;0;Standard;40;Workflow;0;0;Surface;0;0; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;0;0; Use Shadow Threshold;0;0;Receive Shadows;0;0;GPU Instancing;0;638122960154172775;LOD CrossFade;0;638122960159148635;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;DOTS Instancing;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;False;True;False;True;True;False;;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;681;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;684;2590.219,-1372.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;5;d3d11;glcore;gles;gles3;ps5;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;679;2590.219,-1452.336;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;255;False;;255;False;;255;False;;7;False;;1;False;;1;False;;1;False;;7;False;;1;False;;1;False;;1;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 WireConnection;447;0;445;0 WireConnection;398;0;444;0 WireConnection;427;0;398;0 @@ -3859,4 +2722,4 @@ WireConnection;676;4;30;0 WireConnection;676;6;668;0 WireConnection;676;7;667;0 ASEEND*/ -//CHKSM=CA07D4CDB29CB553AB7FEE50AD66956CE8F9E4BE \ No newline at end of file +//CHKSM=A1D29C8AF46B566247CC76C4F45A5068C902EFE3 diff --git a/Assets/ThirdParty/TextMesh Pro/Resources_moved/Shaders/TMP_SDF.shader b/Assets/ThirdParty/TextMesh Pro/Resources_moved/Shaders/TMP_SDF.shader index 5ebf4a7d6..3c3bf34bf 100644 --- a/Assets/ThirdParty/TextMesh Pro/Resources_moved/Shaders/TMP_SDF.shader +++ b/Assets/ThirdParty/TextMesh Pro/Resources_moved/Shaders/TMP_SDF.shader @@ -1,4 +1,4 @@ -Shader "TextMeshPro/Distance Field" { +Shader "TextMeshPro/Distance Field" { Properties { _FaceTex ("Face Texture", 2D) = "white" {} @@ -114,9 +114,9 @@ SubShader { #pragma target 3.0 #pragma vertex VertShader #pragma fragment PixShader - #pragma shader_feature __ BEVEL_ON - #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER - #pragma shader_feature __ GLOW_ON + #pragma shader_feature_local __ BEVEL_ON + #pragma shader_feature_local __ UNDERLAY_ON UNDERLAY_INNER + #pragma shader_feature_local __ GLOW_ON #pragma multi_compile __ UNITY_UI_CLIP_RECT #pragma multi_compile __ UNITY_UI_ALPHACLIP diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 588954424..079ae9b35 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -138,7 +138,6 @@ PlayerSettings: Others: 1 bundleVersion: 1_2022_1 preloadedAssets: - - {fileID: 11400000, guid: a9ace073e7f44b647894afdacacd488d, type: 2} - {fileID: 11400000, guid: 0fba2679222f6944ab7e908389d82c8d, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0